Skip to content

Commit 8c97efb

Browse files
committed
properly respect inherit.aes when looking for geometry column
1 parent 9518944 commit 8c97efb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

R/sf.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,8 @@ LayerSf <- ggproto("LayerSf", Layer,
159159
geometry_col <- "geometry"
160160
}
161161

162-
# isn't quite complete yet, should also check that the global mapping
163-
# doesn't contain a setting for geometry
164-
if (is.null(self$mapping$geometry)) {
162+
if ((isTRUE(self$inherit.aes) && is.null(self$mapping$geometry) && is.null(plot$mapping$geometry)) ||
163+
(isFALSE(self$inherit.aes) && is.null(self$mapping$geometry))) {
165164
self$mapping$geometry <- as.name(geometry_col)
166165
}
167166
}

0 commit comments

Comments
 (0)