Skip to content

Commit

Permalink
Use style.json for debug tiles (#28)
Browse files Browse the repository at this point in the history
* Use style.json for debug tiles

* Fix whoops
  • Loading branch information
louwers authored Oct 10, 2024
1 parent ff7cc1a commit 37e92bf
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 40 deletions.
42 changes: 2 additions & 40 deletions debug-tiles/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,51 +15,13 @@

<div id='map'></div>
<script>
var map = window.map = new maplibregl.Map({
const map = window.map = new maplibregl.Map({
container: 'map',
zoom: 9,
center: [0.0, 0.0],
pitch: 70,
hash: true,
style: {
version: 8,
sources: {
number: {
type: 'raster',
url: 'https://demotiles.maplibre.org/debug-tiles/number/tiles.json',
tileSize: 256,
maxzoom: 22
},
terrainSource: {
type: 'raster-dem',
url: 'https://demotiles.maplibre.org/debug-tiles/terrain-ruffles/tiles.json',
tileSize: 256
},
hillshadeSource: {
type: 'raster-dem',
url: 'https://demotiles.maplibre.org/debug-tiles/number-hillshade/tiles.json',
tileSize: 256
}
},
layers: [
{
id: 'number',
type: 'raster',
source: 'number'
},
{
id: 'hills',
type: 'hillshade',
source: 'hillshadeSource',
layout: {visibility: 'visible'},
paint: {'hillshade-shadow-color': '#473B24'}
}
],
terrain: {
source: 'terrainSource',
exaggeration: 1
}
},
style: "https://demotiles.maplibre.org/debug-tiles/style.json",
maxZoom: 18,
maxPitch: 85
});
Expand Down
43 changes: 43 additions & 0 deletions debug-tiles/style.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"version": 8,
"sources": {
"number": {
"type": "raster",
"url": "https://demotiles.maplibre.org/debug-tiles/number/tiles.json",
"tileSize": 256,
"maxzoom": 22
},
"terrainSource": {
"type": "raster-dem",
"url": "https://demotiles.maplibre.org/debug-tiles/terrain-ruffles/tiles.json",
"tileSize": 256
},
"hillshadeSource": {
"type": "raster-dem",
"url": "https://demotiles.maplibre.org/debug-tiles/number-hillshade/tiles.json",
"tileSize": 256
}
},
"layers": [
{
"id": "number",
"type": "raster",
"source": "number"
},
{
"id": "hills",
"type": "hillshade",
"source": "hillshadeSource",
"layout": {
"visibility": "visible"
},
"paint": {
"hillshade-shadow-color": "#473B24"
}
}
],
"terrain": {
"source": "terrainSource",
"exaggeration": 1
}
}

0 comments on commit 37e92bf

Please sign in to comment.