diff options
Diffstat (limited to 'src/mbgl/annotation/annotation_manager.hpp')
-rw-r--r-- | src/mbgl/annotation/annotation_manager.hpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mbgl/annotation/annotation_manager.hpp b/src/mbgl/annotation/annotation_manager.hpp index 73907e10c8..7e0cf3a394 100644 --- a/src/mbgl/annotation/annotation_manager.hpp +++ b/src/mbgl/annotation/annotation_manager.hpp @@ -58,8 +58,10 @@ private: AnnotationID nextID = 0; using SymbolAnnotationTree = boost::geometry::index::rtree<std::shared_ptr<const SymbolAnnotationImpl>, boost::geometry::index::rstar<16, 4>>; - using SymbolAnnotationMap = std::unordered_map<AnnotationID, std::shared_ptr<SymbolAnnotationImpl>>; - using ShapeAnnotationMap = std::unordered_map<AnnotationID, std::unique_ptr<ShapeAnnotationImpl>>; + // Unlike std::unordered_map, std::map is guaranteed to sort by AnnotationID, ensuring that older annotations are below newer annotations. + // <https://github.com/mapbox/mapbox-gl-native/issues/5691> + using SymbolAnnotationMap = std::map<AnnotationID, std::shared_ptr<SymbolAnnotationImpl>>; + using ShapeAnnotationMap = std::map<AnnotationID, std::unique_ptr<ShapeAnnotationImpl>>; SymbolAnnotationTree symbolTree; SymbolAnnotationMap symbolAnnotations; |