ui-leaflet icon indicating copy to clipboard operation
ui-leaflet copied to clipboard

geojson visibility

Open cyrilchapon opened this issue 8 years ago • 0 comments

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

cyrilchapon avatar Apr 07 '17 09:04 cyrilchapon