library('mapmisc')
library('rgdal')
options(mapmiscCachePath = system.file('extdata', package='mapmisc'))
options(mapmiscVerbose=TRUE)
okinawa = mapmisc::geocode("Okinawa")
## found in cache /tmp/RtmpgnMIET/Rinst3a254fb9fd83/mapmisc/extdata/geocode
hk = y = mapmisc::geocode("Hong Kong")
## found in cache /tmp/RtmpgnMIET/Rinst3a254fb9fd83/mapmisc/extdata/geocode
guam = mapmisc::geocode("Guam")
## found in cache /tmp/RtmpgnMIET/Rinst3a254fb9fd83/mapmisc/extdata/geocode
x = SpatialPoints(cbind(130,15), proj4string=crsLL)
myProj = tpers(x=bind(x,y), hKm = 2*1000,
tilt =-15, axis='seu')
xProj = spTransform(guam, myProj)
yProj = spTransform(hk, myProj)
okinawaProj = spTransform(okinawa, myProj)
myMap = openmap(myProj, path='landscape', zoom=2,fact=3)
## zoom is 2 , 2 tiles
## landscape
## http://tile.opencyclemap.org/landscape/
## downloading http://tile.opencyclemap.org/landscape/2/3/1.png
## downloading http://tile.opencyclemap.org/landscape/2/3/2.png
## reprojecting 131072 cells...
## Warning in rgdal::rawTransform(projfrom, projto, nrow(xy), xy[, 1], xy[, :
## 231 projected point(s) not finite
## Warning in rgdal::rawTransform(projfrom, projto, nrow(xy), xy[, 1], xy[, :
## 231 projected point(s) not finite
## Warning in rgdal::rawTransform(projto_int, projfrom, nrow(xy), xy[, 1], :
## 224155 projected point(s) not finite
## done
## copying colortable for landscape
map.new(myProj, bg='black', buffer=2*100*1000)
plot(myMap, add=TRUE, bgalpha=0)
## Warning in graphics::rasterImage(z, bb[1], bb[3], bb[2], bb[4], interpolate
## = interpolate, : "bgalpha" is not a graphical parameter
if(requireNamespace('maptools')) {
data("wrld_simpl", package='maptools')
wrld4 = wrapPoly(x=wrld_simpl, crs=myProj)
plot(wrld4, add=TRUE)
}
## Loading required namespace: maptools
gridlinesWrap(myProj, col='yellow',
north=seq(-40,40,by=10), easts=seq(-150,180,by=10),
lty=2)
points(xProj, col='red', pch=16, cex=2)
text(xProj@coords,
as.character(xProj$originalPlace),
pos=2, col='red')
points(okinawaProj, col='red', pch=16, cex=2)
text(okinawaProj@coords,
as.character(okinawaProj$originalPlace),
pos=2, col='red')
points(yProj, col='red', pch=16, cex=2)
text(yProj@coords,
as.character(yProj$originalPlace),
pos=2, col='red')

h