diff options
Diffstat (limited to 'src/mbgl/map/map.cpp')
-rw-r--r-- | src/mbgl/map/map.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index 659832dc77..7570a8d303 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -703,10 +703,6 @@ void Map::removeAnnotation(AnnotationID annotation) { update(Update::AnnotationStyle | Update::AnnotationData); } -AnnotationIDs Map::getPointAnnotationsInBounds(const LatLngBounds& bounds) { - return impl->annotationManager->getPointAnnotationsInBounds(bounds); -} - #pragma mark - Feature query api std::vector<Feature> Map::queryRenderedFeatures(const ScreenCoordinate& point, const optional<std::vector<std::string>>& layerIDs) { @@ -735,6 +731,18 @@ std::vector<Feature> Map::queryRenderedFeatures(const ScreenBox& box, const opti }); } +AnnotationIDs Map::queryPointAnnotations(const ScreenBox& box) { + auto features = queryRenderedFeatures(box, {{ AnnotationManager::PointLayerID }}); + AnnotationIDs ids; + ids.reserve(features.size()); + for (auto &feature : features) { + assert(feature.id); + assert(*feature.id <= std::numeric_limits<AnnotationID>::max()); + ids.push_back(static_cast<AnnotationID>(feature.id->get<uint64_t>())); + } + return ids; +} + #pragma mark - Style API style::Source* Map::getSource(const std::string& sourceID) { |