add_kml: Add KML

Description Usage Arguments Examples

View source: R/google_map_layer_kml.R

Description

Adds a KML layer to a map.

Usage

1
add_kml(map, kml_url, layer_id = NULL, update_map_view = TRUE, z_index = 5)

Arguments

map

a googleway map object created from google_map()

kml_url

URL string specifying the location of the kml layer

layer_id

single value specifying an id for the layer. Use this value to distinguish between shape layers for when using any update_ function, and for separating legends.

update_map_view

logical specifying if the map should re-centre according to the shapes

z_index

single value specifying where the circles appear in the layering of the map objects. Layers with a higher z_index appear on top of those with a lower z_index. See details.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 

map_key <- 'your_api_key'

kmlUrl <- "http://googlemaps.github.io/js-v2-samples/ggeoxml/cta.kml"

google_map(key = map_key) %>%
  add_kml(kml_url = kmlUrl)

kmlUrl <- paste0('https://developers.google.com/maps/',
'documentation/javascript/examples/kml/westcampus.kml')

google_map(key = map_key) %>%
  add_kml(kml_url = kmlUrl)


## End(Not run)

Example output



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