1

I uploaded a large (~8GB) geotiff to mapbox using the CLI.

mapbox upload bweinstein.6thBridge_03182020 6thBridge_03182020.tif

Everything appears fine in mapbox studio. Max Zoom is 22 and you can zoom in and see the tiles. It is the top layer in the style. Here is a fully zoomed screenshot.

enter image description here

In Shiny I connect the CARTO integration URL and make sure maxZoomLevels are set

leaflet(data=selected_centroids,options = leafletOptions(minZoom = 7, maxZoom = 22, maxNativeZoom=22)) %>% addTiles(mapbox_url) 

Everything is fine at coarse zoom levels

enter image description here

but then it disappears and turns grey as you zoom.

enter image description here

Reading here: https://docs.mapbox.com/help/troubleshooting/blank-tiles/#style-id

For raster tilesets, the uploaded image resolution sets the minzoom and maxzoom levels. Higher resolution images will result in the tileset rendering at more zoom levels.

Note: regardless of maximum zoom level, data can be overzoomed and visualized to zoom 22.

Is this likely to be a problem in leaflet, in mapbox studio, or in shiny?

0

I found the answer after sitting on this for a month. Its terrible.

The original leaflet statement looks like this

leaflet(data=selected_centroids,options = leafletOptions(minZoom = 7, maxZoom = 22, maxNativeZoom=22)) %>% addTiles(mapbox_url) 

Change the location of tileOptions into the addTiles function, not the leaflet function.

  m<-leaflet(data=selected_centroids) %>% addTiles(mapbox_url,options=tileOptions(maxZoom = 22))

Zoom levels are now respected. I really hope that saves someone else.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.