The points is an @Input() of my component. When I change image and points, yaga-map renders it correctly. But if disable and enable the layer, points from all images are shown.
Scenario.
Open image1 with points1. Map is correct, points1 are on the image1.
Switch to image2 and points2 by changing inputs of the component. Map is correct, points2 are on the image2.
Disable the group layer of points (using the drop-down layer control on the map). Map is correct, image2 has no points.
Enable the group layer (using the drop-down layer control on the map). Map is incorrect, image2 has both points1 and points 2.
The root cause is layers are deleted from the map but are not deleted from layerGroupProvider.
marker.directive.js for example
In the constructor it has
Hi All, I use image as a map and put other layers (marker, circle marker, geojson) on that. HTML skeleton of component looks like that
The points is an
@Input()
of my component. When I change image and points, yaga-map renders it correctly. But if disable and enable the layer, points from all images are shown. Scenario.layerGroupProvider
. marker.directive.js for example In the constructor it haslayerGroupProvider.ref.addLayer(_this);
I changed it to
Then I see in
ngOnDestroy
thatlayerGroupProvider
keeps layers already deleted from the map. I addedremoveLayer()
here.And it solves the issue. Could you fix it please? Please be sure that other directives are affected too.