angular-leaflet-directive
angular-leaflet-directive copied to clipboard
Dynamic add and remove Basic Layers
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?
+1
+1 .. Any update on this issue?