View source: R/google_map_layer_overlay.R
add_overlay | R Documentation |
Adds a ground overlay to a map. The overlay can only be added from a URL
add_overlay(
map,
north,
east,
south,
west,
overlay_url,
layer_id = NULL,
digits = 4,
update_map_view = TRUE
)
map |
a googleway map object created from |
north |
northern-most latitude coordinate |
east |
eastern-most longitude |
south |
southern-most latitude coordinate |
west |
western-most longitude |
overlay_url |
URL string specifying the location of the overlay layer |
layer_id |
single value specifying an id for the layer. |
digits |
integer. Use this parameter to specify how many digits (decimal places) should be used for the latitude / longitude coordinates. |
update_map_view |
logical. Use this parameter to specify if the map should re-centre according to the overlay extent. |
## Not run:
map_key <- 'your_api_key'
google_map(key = map_key) %>%
add_overlay(north = 40.773941, south = 40.712216, east = -74.12544, west = -74.22655,
overlay_url = "https://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg")
url <- paste0("https://developers.google.com/maps/documentation/javascript",
"/examples/full/images/talkeetna.png")
google_map(key = map_key) %>%
add_overlay(north = 62.400471, south = 62.281819, east = -150.005608, west = -150.287132,
overlay_url = url)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.