I have always used PlotOnStaticMap
command to add points to Google Maps plot, but with this code
RangeVenetoLon<-c(10.58, 13.13)
RangeVenetoLat<-c(44.75, 46.71)
MapVeneto<-GetMap.bbox(lonR=RangeVenetoLon, latR=RangeVenetoLat, size = c(640,640),MINIMUMSIZE=T)
PlotOnStaticMap(MapVeneto,lon=xVeneto,lat=yVeneto, FUN = points, pch=16,col="blue")
I've found
Error in points$Tile[, "X"] : subscript out of bounds
Where is the problem?
Your xVeneto
and yVeneto
objects appear to be matrix
objects, when standard vector
s are needed. This works:
PlotOnStaticMap(MapVeneto,lon=xVeneto[,1],lat=yVeneto[,1], FUN = points, pch=16,col="blue")