1
votes

I'm trying to get mapbox gl to display a map of a certain bounds at a certain zoom level no matter the size of the map.

I can set the zoom but then the bounds changes and I can fitBounds but then the zoom changes. It's all vector so it should be possible, I want the styling and tiles from a specific zoom level and a fixed boundary.

If you set maxZoom, minZoom, and maxBounds it appears to ignore the maxBounds.

Is this even possible?

1

1 Answers

1
votes

I don't think what you're asking is possible.

Essentially, you're wanting to change the ratio between each vector tile and the number of pixels it occupies on the screen. (Whether or not the display of each feature is also scaled - like, are icons shrunk or do they just overlap - is a separate question). An extreme case would be displaying the entire world at zoom 15, in one screen.

There might be some hacky workaround you could do with CSS but it's certainly not a normal feature of Mapbox-GL-JS.