Text size is too small in leaflet when using Mapbox style.

Does anyone have any experience with mapbox basemaps in R leaflet?

The font is too small on my map. I have tried to change the zoomOffset and tileSize as detailed here, and in the tileOptions here, but no success.

library(leaflet)

leaflet_url <- "https://api.mapbox.com/styles/v1/williamlai/ckiy242l16cli19mvze8sqlpp/tiles/{z}/{x}/{y}?access_token={access_token}"

# mapbox basemap - font is too small
leaflet() %>%
  addTiles(urlTemplate = leaflet_url,
           tileOptions(tileSize = 512, zoomOffset = -1)) %>%  # the options don't seem to work
  addMarkers(lng=174.768, lat=-36.852)
1 Like

The solution is to request a 256x256 tile.

See here: https://blog.mapbox.com/512-map-tiles-cb5bfd6e72ba

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.