summaryrefslogtreecommitdiff
path: root/platform/macos/src
diff options
context:
space:
mode:
Diffstat (limited to 'platform/macos/src')
-rw-r--r--platform/macos/src/MGLMapView.mm6
-rw-r--r--platform/macos/src/MGLMapViewDelegate.h12
2 files changed, 17 insertions, 1 deletions
diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm
index 154b716377..3c1fe18499 100644
--- a/platform/macos/src/MGLMapView.mm
+++ b/platform/macos/src/MGLMapView.mm
@@ -2108,7 +2108,11 @@ public:
if ([annotation isKindOfClass:[MGLMultiPoint class]])
{
- return false;
+ if ([self.delegate respondsToSelector:@selector(mapView:shapeAnnotationIsEnabled:)]) {
+ return !!(![self.delegate mapView:self shapeAnnotationIsEnabled:(MGLMultiPoint *)annotation]);
+ } else {
+ return false;
+ }
}
MGLAnnotationImage *annotationImage = [self imageOfAnnotationWithTag:annotationTag];
diff --git a/platform/macos/src/MGLMapViewDelegate.h b/platform/macos/src/MGLMapViewDelegate.h
index dae5b40286..2a8b28c1b4 100644
--- a/platform/macos/src/MGLMapViewDelegate.h
+++ b/platform/macos/src/MGLMapViewDelegate.h
@@ -244,6 +244,18 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark Selecting Annotations
/**
+ Returns a Boolean value indicating whether the shape annotation can be selected.
+
+ If the return value is `YES`, the user can select the annotation by clicking
+ on it. If the delegate does not implement this method, the default value is `YES`.
+
+ @param mapView The map view that has selected the annotation.
+ @param annotation The object representing the shape annotation.
+ @return A Boolean value indicating whether the annotation can be selected.
+ */
+- (BOOL)mapView:(MGLMapView *)mapView shapeAnnotationIsEnabled:(MGLShape *)annotation;
+
+/**
Tells the delegate that one of its annotations has been selected.
You can use this method to track changes to the selection state of annotations.