Skip to content

Commit

Permalink
Store google-api-key to localStorage (#386)
Browse files Browse the repository at this point in the history
* Store google-api-key to localStorage

* Fix linting error for localStorage for googleMapsExample.js

* Fix lint with trailing spaces for googleMapsExample.js
  • Loading branch information
jo-chemla authored Jun 26, 2023
1 parent 3a839e6 commit e7810f9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions example/googleMapsExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ let statsContainer, stats;
const raycaster = new Raycaster();
raycaster.firstHitOnly = true;

const apiKey = localStorage.getItem( 'googleApiKey' ) ?? 'put-your-api-key-here';

const params = {

'enableUpdate': true,
'enableCacheDisplay': false,
'enableRendererStats': false,
'apiKey': 'put-your-api-key-here',

'apiKey': apiKey,

'displayBoxBounds': false,
'displaySphereBounds': false,
Expand All @@ -41,6 +42,8 @@ animate();

function reinstantiateTiles() {

localStorage.setItem( 'googleApiKey', params.apiKey );

if ( tiles ) {

scene.remove( tiles.group );
Expand Down

0 comments on commit e7810f9

Please sign in to comment.