Angular Cluster Token Does Not Update Token

I created a plunker to show this behavior, basically what I did was take a demo from angular maps, and modify it a bit to hide 5 markers every time a marker is clicked on the map. Tokens are really hidden, but the cluster does not change. Now here is the weird part, if you drag the map a bit, it will update the cluster correctly, but it does not update automatically.

Onclick event

$scope.clickHandler = function(e) { var count = $scope.randomMarkers.length; var hidden = 0; for (var i = 0; i < count; i++) { var oneModel = $scope.randomMarkers[i]; if (oneModel.options.visible) { console.log("hiding: " + oneModel.latitude); oneModel.options.visible = false; hidden++; if (hidden == 5) break; } } } 

and marker definition

 var ret = { latitude: latitude, longitude: longitude, title: 'm' + i, events: { click: $scope.clickHandler }, options: { visible: true } }; 

are the only real differences from the example (otherwise, to specify the marker directive, actually use the property of the parameters of the marker model.

+6
source share

Source: https://habr.com/ru/post/985506/


All Articles