We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
The text was updated successfully, but these errors were encountered:
You should be able to import it like this:
https://github.com/wcedmisten/map-demo/blob/main/pages/protomap/index.tsx#L7
If the file is in a different directory, you'll need to update that import statement with the new file path.
Sorry, something went wrong.
No branches or pull requests
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
The text was updated successfully, but these errors were encountered: