summaryrefslogtreecommitdiff
path: root/platform/darwin
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-05-26 22:23:06 -0700
committerMinh Nguyễn <mxn@1ec5.org>2016-05-27 21:42:39 -0700
commit974e6696986d49e2eb130e24bde9e75402b0f386 (patch)
tree884e9429aaab158eee8c7ff1c13950a64ca91bb8 /platform/darwin
parentbacf1f59ca8e06b5b5423a35b4e4c30d92624758 (diff)
downloadqtlocation-mapboxgl-974e6696986d49e2eb130e24bde9e75402b0f386.tar.gz
[ios, osx] Ignore compound shape types as annotations
Ignore any multipolyline, multipolygon, or shape collection object passed into -addAnnotation: or -addAnnotations:. Previously, these methods broke apart the compound shape into its constituent shapes in order to recursively add them to the map. But that broke assumptions about a one-to-one correspondence between annotations and their contexts during selection and deletion.
Diffstat (limited to 'platform/darwin')
-rw-r--r--platform/darwin/src/MGLFeature.h5
-rw-r--r--platform/darwin/src/MGLPolygon.h3
-rw-r--r--platform/darwin/src/MGLPolyline.h3
-rw-r--r--platform/darwin/src/MGLShapeCollection.h3
4 files changed, 12 insertions, 2 deletions
diff --git a/platform/darwin/src/MGLFeature.h b/platform/darwin/src/MGLFeature.h
index b593ff70e4..69cff6b054 100644
--- a/platform/darwin/src/MGLFeature.h
+++ b/platform/darwin/src/MGLFeature.h
@@ -19,8 +19,9 @@ NS_ASSUME_NONNULL_BEGIN
Typically, you do not create feature objects yourself but rather obtain them
using `-[MGLMapView visibleFeaturesAtPoint:]` and related methods. Each feature
object associates a shape with an identifier and attributes as specified by the
- source. Like any `MGLAnnotation` object, an `MGLFeature` object can be added to
- a map view using `-[MGLMapView addAnnotations:]` and related methods.
+ source. Like ordinary `MGLAnnotation` objects, some kinds of `MGLFeature`
+ objects can also be added to a map view using `-[MGLMapView addAnnotations:]`
+ and related methods.
*/
@protocol MGLFeature <MGLAnnotation>
diff --git a/platform/darwin/src/MGLPolygon.h b/platform/darwin/src/MGLPolygon.h
index e1dc553f30..3d5b36abb6 100644
--- a/platform/darwin/src/MGLPolygon.h
+++ b/platform/darwin/src/MGLPolygon.h
@@ -60,6 +60,9 @@ NS_ASSUME_NONNULL_BEGIN
object to represent an atoll together with an island in the atoll’s lagoon:
the atoll itself would be one `MGLPolygon` object, while the inner island would
be another.
+
+ @note `MGLMultiPolygon` objects cannot be added to a map view using
+ `-[MGLMapView addAnnotations:]` and related methods.
*/
@interface MGLMultiPolygon : MGLShape <MGLOverlay>
diff --git a/platform/darwin/src/MGLPolyline.h b/platform/darwin/src/MGLPolyline.h
index a453a43a41..78d9649751 100644
--- a/platform/darwin/src/MGLPolyline.h
+++ b/platform/darwin/src/MGLPolyline.h
@@ -36,6 +36,9 @@ NS_ASSUME_NONNULL_BEGIN
both sides of a divided highway (dual carriageway), excluding the median
(central reservation): each carriageway would be a distinct `MGLPolyline`
object.
+
+ @note `MGLMultiPolyline` objects cannot be added to a map view using
+ `-[MGLMapView addAnnotations:]` and related methods.
*/
@interface MGLMultiPolyline : MGLShape <MGLOverlay>
diff --git a/platform/darwin/src/MGLShapeCollection.h b/platform/darwin/src/MGLShapeCollection.h
index f4dc226228..6a21d6fb90 100644
--- a/platform/darwin/src/MGLShapeCollection.h
+++ b/platform/darwin/src/MGLShapeCollection.h
@@ -10,6 +10,9 @@ NS_ASSUME_NONNULL_BEGIN
The `MGLShapeCollection` class represents a shape consisting of one or more
distinct but related shapes that are instances of `MGLShape`. The constituent
shapes can be a mixture of different kinds of shapes.
+
+ @note `MGLShapeCollection` objects cannot be added to a map view using
+ `-[MGLMapView addAnnotations:]` and related methods.
*/
@interface MGLShapeCollection : MGLShape