Hi,
I have copied the layers.json from here to an external file called layer.json
https://github.com/wcedmisten/map-demo/blob/main/data/layers.json
I want to reference it locally as for example:
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
However,when I try to load the Html file,I take this error: ReferenceError: layer is not defined
How should a reference the local layer.json file (It is located in the same directory of the html file).
Any suggestion would be helpful.
Thanks