ggmap
ggmap copied to clipboard
geom_ggmap
Would it be possible to have a geom_ggmap()
that made it easier to add a layer to an existing plot?
I think this should just be a simple modification of insert_raster
that also gets the attributes from the object. Something like:
geom_ggmap <- function(map) {
stopifnot(inherits(map, "ggmap"))
bb <- attr(mi_raster$bb)
GeomRasterAnn$new(
geom_params = list(
raster = raster,
xmin = bb[1],
ymin = bb[2],
xmax = bb[3],
ymax = bb[4]
)
stat = "identity",
position = "identity",
data = NULL,
inherit.aes = FALSE
)
}
(note the use of inherit.aes = FALSE
- insert_raster
should also do that
Linked to #160