Layer selection visibility unchecked in initial state in OpenLayers 3

المشرف العام

Administrator
طاقم الإدارة
I have this JSFiddle example that has two vector layers in it, 'Cities Layer 1' and 'Cities Layer 2'. As you can see from this example, cities layer 1 has a visibility set as the default of true and cities layer 2 has the visibility changed to false so it doesn't bring it in on load. This all works fine.

However, my question is that on load, I would like my glyphicon to be unchecked to show the user that the layer hasn't loaded. I'm guessing I could add some form of 'if' to the visible parameter of the layer in the last section of the JavaScript section?



أكثر...
 
أعلى