add_overlay: Add Overlay

Description Usage Arguments Examples

View source: R/google_map_layer_overlay.R

Description

Adds a ground overlay to a map. The overlay can only be added from a URL

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
add_overlay(
  map,
  north,
  east,
  south,
  west,
  overlay_url,
  layer_id = NULL,
  digits = 4,
  update_map_view = TRUE
)

Arguments

map

a googleway map object created from google_map()

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.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## 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)

Example output



googleway documentation built on Nov. 16, 2020, 9:08 a.m.