-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
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
v12 styles don't work anymore #10
Comments
There is a variation between the style specifications of Mapbox and Maplibre. All you need is a |
Here is a map.setStyle('mapbox://styles/mapbox/streets-v12', {
transformStyle: (previousStyle, nextStyle) => {
if (nextStyle.projection && nextStyle.projection.name) {
delete nextStyle.projection.name;
}
return nextStyle;
},
}); The issue is due to https://maplibre.org/maplibre-style-spec/projection/ |
How does this work in combination with the transformRequest example? import { isMapboxURL, transformMapboxUrl } from 'maplibregl-mapbox-request-transformer'
const mapboxKey = 'pk.123'
const transformRequest = (url: string, resourceType: string) => {
if (isMapboxURL(url)) {
return transformMapboxUrl(url, resourceType, mapboxKey)
}
// Do any other transforms you want
return {url}
}
var map = new maplibregl.Map({
container: 'map',
center: [-122.420679, 37.772537],
zoom: 13,
style: 'mapbox://styles/mapbox/satellite-streets-v11',
transformRequest
}); I added the setStyle with the transformStyle method but to no avail. |
Try adding const map = new maplibregl.Map({
container: mapContainer,
style: 'mapbox://styles/mapbox/satellite-streets-v12?optimize=true',
validateStyle: false,
center: [18.0686, 59.3293],
zoom: 12,
transformRequest,
}); |
Somehow, v12 styles (e.g. mapbox://styles/mapbox/streets-v12) do not work anymore. the models between mapbox and maplibre seem to be out of sync. can we map the models somehow in this library?
The text was updated successfully, but these errors were encountered: