map3d | R Documentation |
This method add a 3D map surface to the RGL plot. The backend map service is supported by OpenStreetMap package. All parameters except for h are consistent with the 'openmap' function in OSM.
map3d(upperLeft, lowerRight, h = 0, ...)
h |
the horizontal plane to locate the map surface |
... |
all other parameters of |
upperLeft |
the upper left lat and long |
lowerRight |
the lower right lat and long |
openmap
data(movement) u1 <- subset(movement, id==3) u1$time <- (u1$time - min(u1$time)) / 3600 lat1 <- min(u1$lat) - 0.005 lat2 <- max(u1$lat) + 0.005 lon1 <- min(u1$lon) - 0.005 lon2 <- max(u1$lon) + 0.005 ## Not run: if(require(OpenStreetMap)){ library(rgl) rgl.clear() rgl.clear("lights") rgl.bg(color="lightgray") rgl.viewpoint(theta=240, phi=45) rgl.light(theta = 45, phi = 45, viewpoint.rel=TRUE) map3d(c(lat1, lon1), c(lat2, lon2), h=min(u1$time)) axes3d(edges = "bbox", labels = TRUE, tick = TRUE, nticks = 5, box=FALSE, expand = 1.03, col="black", lwd=0.8) invisible(readline(prompt="Press [enter] to continue")) rgl.close() } ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.