Issue #2863Opened June 30, 2020by mcottret2 reactions

[Bug]: Programmatic retrieval of layers' visibility always returns `true`

Question

Hello again :)

Our team might have found a bug while using the Layer Manager API: every call to component.viewLayer.isVisible() seems to always return true, regardless of their actual state.

Steps to reproduce:

  • Open the demo
  • Switch to the layers panel
  • Click on the eye icon to hide the "Body" layer
  • Open the console
  • Executing editor.getWrapper().viewLayer.isVisible() returns 1 instead of false

Looking at the code, I believe this.model.getStyle() should be used instead of this.model.get('style') (which always returns {}) to retrieve the current display value.

As always, I'd be happy to open a PR to fix it !

Cheers :)

Answers (2)

artfJuly 5, 20201 reactions

Yeah, you're totally right, the PR is welcome :)

mcottretJuly 6, 20201 reactions

Great ! #2879 opened.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.