Description Usage Arguments Value Note Author(s) Examples
The querying parameters for Open Street Maps are somewhat different in this version.
Instead of a zoom, center and size, the user supplies a scale parameter and a lat/lon bounding box.
The scale determines the image size.
1 2 3 4 5 6 7 8 9 10 |
lonR |
longitude range |
latR |
latitude range |
scale |
Open Street map scale parameter. The larger this value, the smaller the resulting map tile in memory. There is a balance to be struck between the lat/lon bounding box and the scale parameter. |
destfile |
File to load the map image from or save to, depending on |
format |
(optional) defines the format of the resulting image. |
RETURNIMAGE |
return image yes/no default: TRUE |
GRAYSCALE |
Boolean toggle; if TRUE the colored map tile is rendered into a black & white image, see RGB2GRAY |
NEWMAP |
if TRUE, query the Google server and save to |
verbose |
level of verbosity, |
... |
extra arguments to be used in future versions |
map structure or URL used to download the tile.
The OSM maptile server is frequently too busy to accomodate every request, so patience is warranted.
Markus Loecher
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | if (interactive()) {
CologneMap <- GetOsmMap(lonR= c(6.89, 7.09), latR = c(50.87, 51), scale = 150000,
destfile = "Cologne.png");
PlotOnStaticMap(CologneMap, mar=rep(4,4), NEWMAP = FALSE, TrueProj = FALSE, axes= TRUE);
PrincetonMap <- GetOsmMap(lonR= c(-74.67102, -74.63943), latR = c(40.33804,40.3556),
scale = 12500, destfile = "Princeton.png");
png("PrincetonWithAxes.png", 1004, 732)
PlotOnStaticMap(PrincetonMap, axes = TRUE, mar = rep(4,4));
dev.off()
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.