Skip to content

Commit

Permalink
Merge pull request #72 from vakrilov/patch-1
Browse files Browse the repository at this point in the history
Remove markers from internal cache
  • Loading branch information
EddyVerbruggen committed Jan 18, 2017
2 parents fa03c62 + 4661b02 commit fa8f8e5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mapbox.ios.js
Expand Up @@ -218,6 +218,12 @@ mapbox.removeMarkers = function (ids, nativeMap) {
markersToRemove.push(marker.ios);
}
}

// remove markers from cache
mapbox._markers = mapbox._markers.filter(function (marker) {
return ids.indexOf(marker.id) < 0;
})

if (markersToRemove.length > 0) {
theMap.removeAnnotations(markersToRemove);
}
Expand Down Expand Up @@ -873,4 +879,4 @@ var MGLMapViewDelegateImpl = (function (_super) {
return MGLMapViewDelegateImpl;
})(NSObject);

module.exports = mapbox;
module.exports = mapbox;

0 comments on commit fa8f8e5

Please sign in to comment.