angular-ui / ui-leaflet

AngularJS directive to embed an interact with maps managed by Leaflet library
http://angular-ui.github.io/ui-leaflet
Other
314 stars 134 forks source link

removeLayer is not a function #162

Open nmccready opened 9 years ago

nmccready commented 9 years ago

From @antoinegiret on May 7, 2015 14:6

Hi, I have an error when I remove paths having a layer.

TypeError: overlay.removeLayer is not a function

Here is the definition of my layer and my path:

angular.extend($scope, {
   layers: {
      baselayers: {
         ...
      },
      overlays: {
         test: {
            name: 'test',
            visible: false,
            type: 'group'
         }
      }
   },
   paths: {}
});

...

var test = function () {
   $scope.paths['test'] = {
      layer: "test",
      type: "polyline",
      latlngs: latlngs
   };
};

And how I remove it from my map:

$scope.paths = {}

Thanks

Copied from original issue: tombatossals/angular-leaflet-directive#747

nmccready commented 9 years ago

From @antoinegiret on May 13, 2015 7:8

No solutions ?

nmccready commented 9 years ago

I haven't had time to look into it. Have you dug into the directive yourself?