@@ -216,21 +216,23 @@ map.ppi <- function(x, map, param, alpha = 0.7, xlim, ylim,
216
216
# these declarations prevent generation of NOTE "no visible binding for
217
217
# global variable" during package Check
218
218
lon <- lat <- y <- z <- NA
219
+ # extract unique radar locations
220
+ latlon_radar <- unique(data.frame (lat = c(x $ geo $ lat ), lon = c(x $ geo $ lon )))
219
221
# symbols for the radar position
220
222
# dummy is a hack to be able to include the ggplot2 color scale,
221
223
# radarpoint is the actual plotting of radar positions.
222
224
dummy <- geom_point(aes(x = lon , y = lat , colour = z ),
223
225
size = 0 ,
224
226
data = data.frame (
225
- lon = x $ geo $ lon ,
226
- lat = x $ geo $ lat ,
227
+ lon = latlon_radar $ lon ,
228
+ lat = latlon_radar $ lat ,
227
229
z = 0
228
230
)
229
231
)
230
232
radarpoint <- geom_point(aes(x = lon , y = lat ),
231
233
colour = radar_color ,
232
234
size = radar_size ,
233
- data = data.frame (lon = x $ geo $ lon , lat = x $ geo $ lat )
235
+ data = data.frame (lon = latlon_radar $ lon , lat = latlon_radar $ lat )
234
236
)
235
237
# bounding box
236
238
bboxlatlon <- attributes(map )$ geo $ bbox
@@ -248,4 +250,5 @@ map.ppi <- function(x, map, param, alpha = 0.7, xlim, ylim,
248
250
scale_y_continuous(limits = ylim , expand = c(0 , 0 ))
249
251
)
250
252
suppressWarnings(mymap )
253
+
251
254
}
0 commit comments