angular-leaflet-directive icon indicating copy to clipboard operation
angular-leaflet-directive copied to clipboard

Dynamic add and remove Basic Layers

Open RickyCampos opened this issue 9 years ago • 2 comments

I need help because even though I try not find solution. I'm from Spain, so sorry for the English.

I am developing an application in which I use this library to upload images and draw polygons on them.

I will not need to use more than one image simultaneously. I just need a picture.

The problem comes when I want to change the image, since the view is not updated strangely.

I do the following:

     delete $scope.layers.baselayers.img;
     $scope.layers.baselayers.img = sourceTemplate;
     // SourceTemplate is a layer that generated dynamically with the photo you've uploaded.

If I make a console.log ($ scope.layers.baselayers) the result is correct, that is, the layer is that just generate and the controLayer the name I have given appears, but the picture is not shown image of that layer, but the layer that I just deleted.

If I do the following:

delete $ scope.layers.baselayers.img;
$scope.layers.baselayers.img = sourceTemplate;
$scope.layers.baselayers.img2 = sourceTemplate;

Thus, both layers are created. The first layer shows the image of the layer that I just deleted, and the second layer is shown as it should.

Does anyone know why this happens? Is it a bug?

RickyCampos avatar Dec 28 '15 16:12 RickyCampos

+1

marioot avatar Feb 19 '16 15:02 marioot

+1 .. Any update on this issue?

kslo88 avatar Feb 14 '17 21:02 kslo88