getBaiduMap: Get map from Baidu API

Description Usage Arguments Value Examples

Description

Take in coordiantes and return the location

Usage

1
2
getBaiduMap(location, width = 400, height = 400, zoom = 10, scale = 2,
  color = "color", messaging = TRUE)

Arguments

location

a vector a or matrix contains longtitude and latitude of the center of the map, or a character refers to the address

width

width of the map

height

height of the map

zoom

map zoom, an integer from 3 (continent) to 21 (building), default value 10 (city)

scale

multiplicative factor for the number of pixels returned. possible values are 2 or anything else.

color

"color" or "bw", color or black-and-white

messaging

logical. whether to print the download messages.

Value

A ggmap object. a map image as a 2d-array of colors as hexadecimal strings representing pixel fill values.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
library(ggmap)  
## Beijing
p <- getBaiduMap(c(116.39565, 39.92999))
ggmap(p)

p <- getBaiduMap('beijing') # the same
ggmap(p)

## black-and-white
p <- getBaiduMap(color='bw')
ggmap(p)

## do not print messages
p <- getBaiduMap(messaging = F)

## End(Not run)

badbye/baidumap documentation built on May 11, 2019, 5:24 p.m.