diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2016-07-16 14:19:14 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2016-07-18 15:21:35 -0700 |
commit | 8179f2f6b2c185c16745c6a3faf4d4bd9683ef16 (patch) | |
tree | e88ec0d143bd6bc6e65ddb9641e95ac2592ac0b4 /src | |
parent | ede1e713d8b66be713d96141653b83078443cbea (diff) | |
download | qtlocation-mapboxgl-8179f2f6b2c185c16745c6a3faf4d4bd9683ef16.tar.gz |
[core] Restored shape annotation z-order
Shapes are once again always added to the top z-index.
Fixes #5691.
Cherry-picked from 74fe96d2617f870206ff358d7dfcafccf4e109bc.
Diffstat (limited to 'src')
-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; |