ui-leaflet
ui-leaflet copied to clipboard
geojson visibility
I use nested geojson stuff :
<leaflet
...
geojson="map.geojson"
geojson-nested="true"
...>
</leaflet>
$scope.map = {
...
geojson: {
ways: _.extend({}, mapStyles.ways, {
name:'ways',
visible: true
})
},
...
};
And visible toggle doesn't work.
Even worse, if I map.removeLayer(<mylayer>) (which works), when I update $scope.map.geojson.ways.data, it readds the layer to the map.
I also tried
$scope.map = {
...
geojson: {
ways: _.extend({}, mapStyles.ways, {
name:'ways',
visible: false, // <--- notice this
layerOptions: {
visible: false // <--- and this
},
layerOptions: {
visible: false // <--- and this
}
})
},
...
};
None worked
I didn't try non-nested geojson