diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-05-31 17:34:11 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-06-01 17:37:01 -0700 |
commit | 0fba70d5a8465499b0dce900e5aa74f7189e4594 (patch) | |
tree | 7902b9bd29d25de0de6d116fc3245b1b269477f4 /src/mbgl/map | |
parent | cfd6757ecc9bd4d9b1f4c5266d19da48c529f58b (diff) | |
download | qtlocation-mapboxgl-0fba70d5a8465499b0dce900e5aa74f7189e4594.tar.gz |
[all] Rationalize annotation API
Diffstat (limited to 'src/mbgl/map')
-rw-r--r-- | src/mbgl/map/map.cpp | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index e0a73c2a06..f89fde1f03 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -3,8 +3,6 @@ #include <mbgl/map/view.hpp> #include <mbgl/map/transform.hpp> #include <mbgl/map/transform_state.hpp> -#include <mbgl/annotation/point_annotation.hpp> -#include <mbgl/annotation/shape_annotation.hpp> #include <mbgl/annotation/annotation_manager.hpp> #include <mbgl/style/style.hpp> #include <mbgl/style/style_observer.hpp> @@ -693,37 +691,19 @@ double Map::getTopOffsetPixelsForAnnotationIcon(const std::string& name) { return impl->annotationManager->getTopOffsetPixelsForIcon(name); } -AnnotationID Map::addPointAnnotation(const PointAnnotation& annotation) { - return addPointAnnotations({ annotation }).front(); -} - -AnnotationIDs Map::addPointAnnotations(const std::vector<PointAnnotation>& annotations) { - auto result = impl->annotationManager->addPointAnnotations(annotations, getMaxZoom()); - update(Update::Annotations); - return result; -} - -AnnotationID Map::addShapeAnnotation(const ShapeAnnotation& annotation) { - return addShapeAnnotations({ annotation }).front(); -} - -AnnotationIDs Map::addShapeAnnotations(const std::vector<ShapeAnnotation>& annotations) { - auto result = impl->annotationManager->addShapeAnnotations(annotations, getMaxZoom()); +AnnotationID Map::addAnnotation(const Annotation& annotation) { + auto result = impl->annotationManager->addAnnotation(annotation, getMaxZoom()); update(Update::Annotations); return result; } -void Map::updatePointAnnotation(AnnotationID annotationId, const PointAnnotation& annotation) { - impl->annotationManager->updatePointAnnotation(annotationId, annotation, getMaxZoom()); +void Map::updateAnnotation(AnnotationID id, const Annotation& annotation) { + impl->annotationManager->updateAnnotation(id, annotation, getMaxZoom()); update(Update::Annotations); } void Map::removeAnnotation(AnnotationID annotation) { - removeAnnotations({ annotation }); -} - -void Map::removeAnnotations(const AnnotationIDs& annotations) { - impl->annotationManager->removeAnnotations(annotations); + impl->annotationManager->removeAnnotation(annotation); update(Update::Annotations); } |