PlotOnStaticMap error: Error in points$Tile[, "X"] : subscript out of bounds

319 views Asked by At

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?

1

There are 1 answers

0
nicola On BEST ANSWER

Your xVeneto and yVeneto objects appear to be matrix objects, when standard vectors are needed. This works:

    PlotOnStaticMap(MapVeneto,lon=xVeneto[,1],lat=yVeneto[,1], FUN = points, pch=16,col="blue")