Skip to content

Commit

Permalink
add apikeys.js, .gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
anneb committed Apr 9, 2019
1 parent aa6d637 commit 9fc4e5a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apikeys.js
*.pnts
*.b3dm
tileset.json
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ tar zxvf ahn_points.tar.gz
cd ../rotterdam
tar zxvf rotterdam_3dtiles_small.tar.gz
```
Next, edit index.html and enter your [mapbox token](https://docs.mapbox.com/help/how-mapbox-works/access-tokens/). Point your browser to the directory in question and you should see a basic viewer with 3d tiles content.
Next, copy file "apikeys.js.example" to "apikeys.js" and add your [mapbox token](https://docs.mapbox.com/help/how-mapbox-works/access-tokens/). Point your browser to the directory in question and you should see a basic viewer with 3d tiles content.

## Creating tilesets
Tilesets can be created using [py3dtiles](https://github.com/Oslandia/py3dtiles), using a PostGIS database table as source. The PostGIS table should contain 3D geometries in EPSG:3857 projection.
Expand Down
3 changes: 3 additions & 0 deletions apikeys.js.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const apiKeys = {
mapboxAccessToken: "<your mapboxAccessToken here>"
}
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<script src='https://cdnjs.cloudflare.com/ajax/libs/three.js/101/three.min.js'></script>
<script src="GLTFLoader.js"></script>
<script src="Mapbox3DTiles.js"></script>
<script src="apikeys.js"></script>
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
Expand All @@ -19,7 +20,7 @@
<div id='map'></div>

<script>
mapboxgl.accessToken = '<your mapbox token here>';
mapboxgl.accessToken = apiKeys.mapboxAccessToken;

// Load the mapbox map
var map = new mapboxgl.Map({
Expand Down

0 comments on commit 9fc4e5a

Please sign in to comment.