I can do this fine for one polygram BUT a for-loop fails.The concept is
multiple lines within each polygon. I am doing something sub-genius.
ONE POLYGON
plot(all_pcts_osm_sp[i,], add = FALSE, lwd=.5, border='blue')
hght <- strheight("Here")
MyLines <- list(
bquote( .(all_pcts_osm_sp$PCT[i]) ),
bquote( .(all_pcts_osm_sp$First_Name[i]) ),
bquote( .(all_pcts_osm_sp$Last_Name[i]) ),
bquote( .(all_pcts_osm_sp$Phone) ))
text( all_pcts_osm_sp[i,]@polygons[[ 1 ]]@labpt[[1]],
all_pcts_osm_sp[i,]@polygons[[ 1 ]]@labpt[[2]] - (hght * 1.5 *
seq(length(MyLines))),
do.call(expression, MyLines))
ALL POLYGONS JUST DO NOT WORK. PUZZLED? Help me please. Also ultimate
target is an OpenStreet ("OSM") backdrop.
tmp_sp_length <- length(all_pcts_osm_sp)
i = 1
for(i in 1:tmp_sp_length) {
hght <- strheight("Here")
MyLines <- list(
bquote( .(all_pcts_osm_sp$PCT[i]) ),
bquote( .(all_pcts_osm_sp$First_Name[i]) ),
bquote( .(all_pcts_osm_sp$Last_Name[i]) ),
bquote( .(all_pcts_osm_sp$Phone) ))
text( all_pcts_osm_sp[i,]@polygons[[ 1 ]]@labpt[[1]],
all_pcts_osm_sp[i,]@polygons[[ 1 ]]@labpt[[2]] - (hght * 1.5 *
seq(length(MyLines))),
do.call(expression, MyLines))
}
All your comments, ideas, and thoughts are appreciated.
Thanks
Jim Burke
[[alternative HTML version deleted]]
Setup for the OSM Map is below
ul <- as.vector(cbind(bbox(all_pcts_osm_sp) [2,2], bbox(all_pcts_osm_sp)
[1,1]))
lr <- as.vector(cbind(bbox(all_pcts_osm_sp) [2,1], bbox(all_pcts_osm_sp)
[1,2]))
map_types <- c("osm", "maptoolkit-topo",
"waze", "mapquest",
"mapquest-aerial",
"bing", "stamen-toner", "stamen-terrain",
"stamen-watercolor",
"osm-german",
"osm-wanderreitkarte", "mapbox", "esri",
"esri-topo", "nps",
"apple-iphoto",
"skobbler", "opencyclemap", "osm-transport",
"osm-public-transport",
"osm-bbike", "osm-bbike-german")
MyMap <- openmap(ul,lr, zoom = NULL, minNumTiles = 16L, type map_types[1]
,mergeTiles = TRUE)
# now plot the layer and the backdrop
par(mar = c(0,0,0,0))
plot(MyMap)
plot(spTransform(all_pcts_osm_sp, osm()), add = FALSE, lwd=.5,
border='blue')
[[alternative HTML version deleted]]