Replies: 3 comments
-
You should do something like
Remember to read https://developer.mozilla.org/en-US/docs/Web/API/fetch and beware the scope of your variables when doing asynchronous stuff. |
Beta Was this translation helpful? Give feedback.
-
Converting to discussion... |
Beta Was this translation helpful? Give feedback.
-
@IvanSanchez Ivan,thank you for the answer. I will try to use what you suggested,thanks again |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I want to reference a local Layer file(layer.json) using this code:
const map = new maplibregl.Map({
container: 'map',
zoom: h.maxZoom-2,
center: [h.centerLon, h.centerLat],
style: {
version:8,
glyphs:'https://cdn.protomaps.com/fonts/pbf/{fontstack}/{range}.pbf',
sources: {
"openmaptiles": {
type: "vector",
url: "pmtiles://" + PMTILES_URL,
attribution: '© OpenStreetMap'
}
},
layers:layer.json
The layer.json file is in the same directory with the html file.However,when I load the html file ,I get "layer is not defined"
How can I use the "layers" property correctly?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions