Learn R Programming

googleway (version 2.2.0)

add_kml: Add KML

Description

Adds a KML layer to a map.

Usage

add_kml(map, kml_url, layer_id = NULL)

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.

Examples

Run this code


map_key <- 'your_api_key'

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

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


Run the code above in your browser using DataLab