Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set layer visibility #44

Closed
naub1n opened this issue Apr 30, 2019 · 1 comment
Closed

Set layer visibility #44

naub1n opened this issue Apr 30, 2019 · 1 comment
Assignees
Labels

Comments

@naub1n
Copy link

naub1n commented Apr 30, 2019

hi,

How i can set default visibility of layer when web application loading map ?
Exemple :

// ==================================================
// Add heatmap
// --------------------------------------------------
var heatMap = new ol.layer.Heatmap({
      source: new ol.source.Vector({
          url: examples + '/data/kml/2012_Earthquakes_Mag5.kml',
          format: new ol.format.KML({extractStyles: false})
      }),
      blur: 10,
      radius: 10
});
heatMap.set('name','Heat Map');

When I add heatMap.setVisible(false);, layer is not visible but item in layers list is still activated.

@dpmcmlxxvi dpmcmlxxvi self-assigned this May 31, 2019
@dpmcmlxxvi dpmcmlxxvi added the bug label May 31, 2019
@dpmcmlxxvi
Copy link
Owner

dpmcmlxxvi commented May 31, 2019

@naub1n Looks like you cannot at the moment. The initial visibility is not being checked before the layer is added to the explorer. It assumes the layer is visible, which is not correct. I'll try to push a patch soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants