# NOT RUN {
map_key <- "your api key"
google_map(
key = map_key
, data = tram_stops
) %>%
add_markers(
lat = "stop_lat"
, lon = "stop_lon"
, info_window = "stop_name"
)
## using marker icons
iconUrl <- paste0("https://developers.google.com/maps/documentation/",
"javascript/examples/full/images/beachflag.png")
tram_stops$icon <- iconUrl
google_map(
key = map_key
, data = tram_stops
) %>%
add_markers(
lat = "stop_lat"
, lon = "stop_lon"
, marker_icon = "icon"
)
## Clustering
google_map(
key = map_key
, data = tram_stops
) %>%
add_markers(
lat = "stop_lat"
, lon = "stop_lon"
, info_window = "stop_name"
, cluster = TRUE
, cluster_options = list( minimumClusterSize = 5 )
)
# }
Run the code above in your browser using DataLab