diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2016-05-26 22:23:06 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2016-05-27 21:42:39 -0700 |
commit | 974e6696986d49e2eb130e24bde9e75402b0f386 (patch) | |
tree | 884e9429aaab158eee8c7ff1c13950a64ca91bb8 /platform/osx/src/MGLMapView.mm | |
parent | bacf1f59ca8e06b5b5423a35b4e4c30d92624758 (diff) | |
download | qtlocation-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/osx/src/MGLMapView.mm')
-rw-r--r-- | platform/osx/src/MGLMapView.mm | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/platform/osx/src/MGLMapView.mm b/platform/osx/src/MGLMapView.mm index 660c5d9ee0..c398a9424b 100644 --- a/platform/osx/src/MGLMapView.mm +++ b/platform/osx/src/MGLMapView.mm @@ -1621,16 +1621,10 @@ public: } shapes.emplace_back(multiPoint.annotationSegments, [multiPoint shapeAnnotationPropertiesObjectWithDelegate:self]); [userShapes addObject:annotation]; - } else if ([annotation isKindOfClass:[MGLMultiPolyline class]]) { - // TODO: Add real support for these types down in mbgl instead of breaking the annotation apart. - NS_ARRAY_OF(MGLPolyline *) *polylines = [(MGLMultiPolyline *)annotation polylines]; - [self addAnnotations:polylines]; - } else if ([annotation isKindOfClass:[MGLMultiPolygon class]]) { - NS_ARRAY_OF(MGLPolygon *) *polygons = [(MGLMultiPolygon *)annotation polygons]; - [self addAnnotations:polygons]; - } else if ([annotation isKindOfClass:[MGLShapeCollection class]]) { - NS_ARRAY_OF(MGLShape <MGLAnnotation> *) *shapes = [(MGLShapeCollection *)annotation shapes]; - [self addAnnotations:shapes]; + } else if ([annotation isKindOfClass:[MGLMultiPolyline class]] + || [annotation isKindOfClass:[MGLMultiPolygon class]] + || [annotation isKindOfClass:[MGLShapeCollection class]]) { + continue; } else { MGLAnnotationImage *annotationImage = nil; if (delegateHasImagesForAnnotations) { |