Skip to content

Instantly share code, notes, and snippets.

@CraigglesO
Created November 10, 2023 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CraigglesO/2c9a3f741c6f3c7d276dde282aa82e6e to your computer and use it in GitHub Desktop.
Save CraigglesO/2c9a3f741c6f3c7d276dde282aa82e6e to your computer and use it in GitHub Desktop.
Example bug report on pattern loading
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Step Zoom bug</title>
<script src='./dist/maplibre-gl-dev.js'></script>
<link href='https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.css' rel='stylesheet' />
</head>
<body>
<div id='map' style='width: 500px; height: 400px;'></div>
<script>
var map = new maplibregl.Map({
container: 'map', // container id
style: {
"version":8,
"name":"OSM Bright",
"sources":{
"openmaptiles":{
"type":"vector",
"url":"https://demotiles.maplibre.org/tiles-omt/tiles.json"
}
},
"sprite":"https://demotiles.maplibre.org/styles/osm-bright-gl-style/sprite",
"glyphs":"https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf",
"layers":[
{
"id":"background",
"type":"background",
"paint":{
"background-color":"#f8f4f0"
}
},
{
"id":"water",
"type":"fill",
"metadata":{
"mapbox:group":"1444849382550.77"
},
"source":"openmaptiles",
"source-layer":"water",
"layout":{
"visibility":"visible"
},
"paint":{
"fill-color":"hsl(210, 67%, 85%)"
}
},
{
"id": "patternbug",
"type": "fill",
"source": "openmaptiles",
"source-layer": "water",
"layout": {},
"paint": {
"fill-pattern": [
"step",
["zoom"],
"zoo_11",
4,
"volcano_11"
]
}
}
]
},
center: [13, 45],
zoom: 2
});
</script>
</body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment