Skip to content

Don't export LayerSf #3158

Closed
Closed

Description

@clauswilke

When I implemented custom layers for sf objects, I exported the relevant layer object, LayerSf():

ggplot2/R/layer-sf.R

Lines 3 to 8 in 033fb52

#' @export
#' @include layer.r
#' @rdname ggsf
#' @usage NULL
#' @format NULL
LayerSf <- ggproto("LayerSf", Layer,

This is bad, because we currently don't export its parent, Layer(), and we don't want to export it at this time.

The correct way to make the sf-specific layer available is to add a constructor function, layer_sf(), which replaces the layer() function for sf layers.

Activity

  1. self-assigned this
    on Feb 22, 2019
  2. yutannihilation commented on Feb 22, 2019

    @yutannihilation
    Member

    Probably, we should not expose layer_class argument of layer() as well; the user cannot provide any Layer class as it's not exported.

    show.legend = NA, layer_class = Layer) {

  3. paleolimbot commented on Feb 22, 2019

    @paleolimbot
    Member

    @clauswilke : I think you asked...I've never needed to use layer() when creating a geom_sf() layer...the only thing I've changed is the Stat passed to geom_sf().

  4. lock commented on Sep 23, 2019

    @lock

    This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

  5. locked and limited conversation to collaborators on Sep 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions