knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(myMap)

myMap is a package implementing an R6 class constructor to download a map from Stamen API:[http://maps.stamen.com].

The constructor consists of 3 public methods and a private method. initialize method starts the function as it is called with the appropriate arguments. ## Call

A new object will be generated as the constructor ic called:

myMap = MapStamen$new(left = 86.05, bottom = 27.21,
                      right = 87.81, top = 28.76,
                      mapType = "terrain-background", Zoom = 8)

This call generates a new object named "myMap" which is actually a map extracted from Stamen API.

Arguments

A map which is going to be extracted from Stamen should be defined by a box. The lower-left and upper-rigt points coordinates of the box should therefor be passed as the arguments.

left: Provides the lower-left longtitude of the box. bottom: Provides the lower-left latitude of the box. right: Provides the upper-right longitude. top: Provides the upper-right latitude.

Methods

showMap

This method will show the myMap:

myMap$showMap()

This is the map of the area of interest for the mapType = "terrain-background".

If we set mapType = "terrain":

myMap = MapStamen$new(left = 86.05, bottom = 27.21,
                      right = 87.81, top = 28.76,
                      mapType = "terrain", Zoom = 8)

myMap$showMap()

saveMap

This method will save a png file of myMap in the working directory.

myMap$saveMap()


alieti/myMap documentation built on Nov. 2, 2019, 1:40 p.m.