You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 20, 2019. It is now read-only.
I am trying to find a marker within a markerclustergroup overlay by using the following code:
$timeout(function(){
leafletData.getLayers().then(function(layers) {
$scope.markerClusterGrp = layers.overlays.locations;
var clusters = $scope.markerClusterGrp.getLayers();
for (var i in clusters){
if (marker.title == clusters[i].options.title) {
childMarker = clusters[i];
break;
}
}
});
},1000);
I'm assuming that the options.title property in the clusters object is same as the marker.title property that I initially defined while creating the markers. However once I apply a filter to the markers, the options.title property in the clusters object does not match up. To illustrate this I have created a fiddle:
If you open up the console and play around with the filter you will see a log of the $scope.marker titles and clusters options.titles.
I am not sure if my assumption about .title is incorrect or if this is a bug. Is there a better way to find a marker within a markerclustergroup? My eventual objective is to find the parent cluster of this marker and highlight it on a mouseover event. I am using latest v. of this directive, and angular 1.2.8. Thanks!
From @mukhtyar on March 21, 2014 17:4
I am trying to find a marker within a markerclustergroup overlay by using the following code:
I'm assuming that the options.title property in the clusters object is same as the marker.title property that I initially defined while creating the markers. However once I apply a filter to the markers, the options.title property in the clusters object does not match up. To illustrate this I have created a fiddle:
http://jsfiddle.net/mukhtyar/pHeKJ/
If you open up the console and play around with the filter you will see a log of the $scope.marker titles and clusters options.titles.
I am not sure if my assumption about .title is incorrect or if this is a bug. Is there a better way to find a marker within a markerclustergroup? My eventual objective is to find the parent cluster of this marker and highlight it on a mouseover event. I am using latest v. of this directive, and angular 1.2.8. Thanks!
Copied from original issue: tombatossals/angular-leaflet-directive#337
The text was updated successfully, but these errors were encountered: