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 authored Jan 18, 2017
2 parents 9beba3d + b778e86 commit 90e6c2d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mapbox.ios.js
Original file line number Diff line number Diff line change
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 90e6c2d

Please sign in to comment.