Correct settings for using new mapbox styles (rendered, nonvector) image tiles
See original GitHub issueHi All,
When I use the new mapbox styles image tiles, they render too small:
mapTileLabelUrl = 'https://api.mapbox.com/styles/v1/t*****t/'+feed.themeParameters.base_labels_id_vector+'/tiles/{z}/{x}/{y}?access_token=' + accessToken;
baseLabelsLayer = new L.tileLayer(mapTileLabelUrl, {
attribution: attribution,
zoomControl:false,
pane: labelPane,
// detectRetina: true
// zoomOffset:-1,
//tileSize: 512
}).addTo(map);
I tried to use {tileSize: 512} and {tileSize: 128} on the tileLayer to no avail. Is there any way to scale the base tiles, to make the tiles bigger? Can’t find much documentation.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Styles | Mapbox Studio manual
The Mapbox Studio style editor is a tool for creating map styles. A style is a set of rules for how your map...
Read more >Layers | Style Specification | Mapbox GL JS
A line style layer renders one or more stroked polylines on the map. You can use a line layer to configure the visual...
Read more >Styles | API - Mapbox docs
The Mapbox Styles API lets you read and change map styles, fonts, and images.
Read more >Using recolorable images in Mapbox maps | Help
There are many ways to display and style images on Mapbox maps. This guide walks through how to add recolorable images — images...
Read more >Use your Mapbox Studio styles everywhere
To make this possible, we render vector tiles into raster images… ... Or create a new Mapbox.js map and add a style layer...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The issue can be fixed by using
zoomOffset: -1
: http://playground-leaflet.rhcloud.com/moy/edit?html,outputThis actually makes sense, since with 512x512 pixels tiles, if you want the world to cover exactly one tile on zoom 0, you can’t use the same scale factor as Leaflet’s default (which is based on 256 pixel tiles). Hence,
zoomOffset
to the rescue.While this might hard to figure out, I have a bit of a hard time to see how this can be solved on Leaflet’s side, since it really depends on the tile server’s configuration. I don’t think this is an issue in Leaflet, after all.
Thank you for looking into this!! I really appreciate it.
I posted this on stackoverflow on a related question: http://stackoverflow.com/questions/35590579/is-it-possible-to-use-leaflet-version-1-with-custom-mapbox-style
Seems like mapbox could improve the docs on this.