Skip to content

plot_mapbox() forces scattermapbox #1608

Closed
@cpsievert

Description

@cpsievert

For example, this generates a scattermapbox trace:

plot_mapbox() %>%
  add_trace(
    type = "choroplethmapbox",
    geojson = "https://raw.githubusercontent.com/python-visualization/folium/master/examples/data/us-states.json",
    locations = c("NY", "MA", "VT"),
    z = c(1, 2, 3)
  )

In the meantime, you can avoid the issue by using plot_ly() and specify config.mapboxAccessToken:

plot_ly() %>%
  add_trace(
    type = "choroplethmapbox",
    geojson = "https://raw.githubusercontent.com/python-visualization/folium/master/examples/data/us-states.json",
    locations = c("NY", "MA", "VT"),
    z = c(1, 2, 3)
  ) %>%
  config(
    mapboxAccessToken = Sys.getenv("MAPBOX_TOKEN")
  )

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions