Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

"visible" attribute is misleading and could be deprecated #1245

Open
@mangecoeur

Description

The "visible" attribute of Layers gives users the idea that there is a "visible" toggle in Leaflet that allows them to load data into the browser and toggle visibility on and off.

But this is not the case, instead some (but not all) layers special case the visible attribute and don't add the layer data to leaflet if it's false. This means that users are sending data to the browser that then gets discarded, rather than "efficiently" preparing layers in the browser and just toggling their rendering. Furthermore, some layers just don't implement this case leading to confusion (e.g. #1244 ), and toggling the visible attribute on an already created layer doesn't always work.

The simplest solution would be to document+deprecate the visible attr - because (at least at a glance) Leaflet doesn't support visibility toggling at all, only adding or not the data to the map.

Metadata

Metadata

Assignees

No one assigned

    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

        AltStyle によって変換されたページ (->オリジナル) /