Thin Wrapper for Mapping Library 'AMap'('Gaode')

Build and control interactive 2D and 3D maps with 'R/Shiny'. Lean set of powerful commands wrapping native calls to 'AMap' < https://lbs.amap.com/api/jsapi-v2/summary/>. Deliver rich mapping functionality with minimal overhead.


amapro        

R-CMD-check size website

A thin R wrapper around Javascript library AMap and its 3D plugin Loca.
API has eight(8) commands to enclose all AMap and Loca v.2.0 native commands and parameters.
Features easy transition 2D to/from 3D, variety of markers and layers, geoJson import, map manual drawing, dynamic 3D effects like flyover and trace animation, and more.
Enjoy rich interactive maps in R and Shiny with minimal overhead!

Installation

Use latest development version for optimal experience:

if (!requireNamespace('remotes')) install.packages('remotes')
remotes::install_github('helgasoft/amapro')

Examples

Minimal

library(amapro); am.init()

Extended

center <- c(22.430151, 37.073011)
turl <- paste0('http://server.arcgisonline.com/ArcGIS/rest/services/',
                 'World_Imagery/MapServer/tile/[z]/[y]/[x]')
helmet <- 'https://upload.wikimedia.org/wikipedia/commons/9/9d/Ancient_Greek_helmet.png'

library(amapro)
am.init(viewMode= '3D', center= center, zoom= 10, pitch= 60) |>
am.control(ctype= 'ControlBar', position= 'RT') |>
am.item('TileLayer', tileUrl= turl) |>
am.item('Marker', name='m$mark1', position= center, icon= helmet, 
  on= list(    # list of events handled with JavaScript
    list(e='click', f="function(e) { alert('Sparta coordinates: ' + e.lnglat);}"))
) |>
am.cmd('set', 'InfoWindow', name='m$iwin', content='This is Sparta') |>
am.cmd('open', 'm$iwin', 'm$jmap', center)   # m$jmap is the map name in JavaScript
# ... then open in browser for best performance

Demo

Run with command demo(am.shiny, 'amapro'). Demo will open in default browser.


demo
Made with amapro. Powered by AMap.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("amapro")

0.1.5 by Larry Helgason, 8 days ago


https://github.com/helgasoft/amapro/, https://helgasoft.github.io/amapro/


Report a bug at https://github.com/helgasoft/amapro/issues/


Browse source code at https://github.com/cran/amapro


Authors: Larry Helgason [aut, cre, cph]


Documentation:   PDF Manual  


Apache License (>= 2) license


Imports htmlwidgets, tcltk

Suggests shiny, shinyjs, shinythemes, jsonlite, rmarkdown, knitr, testthat


See at CRAN