Skip to contents

This function adds a tile layer from Amap to a leaflet map object.

Usage

addTilesAmap(
  map,
  attribution = "&copy; <a href=\"http://amap.com\">amap.com</a >",
  ...
)

Arguments

map

A leaflet map object to which the tile layer will be added.

attribution

A string containing the attribution text to be displayed on the map. It defaults to "&copy; <a href=\"http://amap.com\">amap.com</a>".

...

Additional arguments to be passed to the `leaflet::addTiles` function.

Value

The leaflet map object with the added tile layer.

Examples

library(leaflet)
leaflet() %>%
  addTilesAmap() %>%
  setView(
    lng = 120.33739,
    lat = 31.13533,
    zoom = 3
  )