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 /platform/darwin/src/MGLPolyline.mm | |
parent | cfd6757ecc9bd4d9b1f4c5266d19da48c529f58b (diff) | |
download | qtlocation-mapboxgl-0fba70d5a8465499b0dce900e5aa74f7189e4594.tar.gz |
[all] Rationalize annotation API
Diffstat (limited to 'platform/darwin/src/MGLPolyline.mm')
-rw-r--r-- | platform/darwin/src/MGLPolyline.mm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/platform/darwin/src/MGLPolyline.mm b/platform/darwin/src/MGLPolyline.mm index ebba5c862e..15ea5a0952 100644 --- a/platform/darwin/src/MGLPolyline.mm +++ b/platform/darwin/src/MGLPolyline.mm @@ -13,12 +13,7 @@ return [[self alloc] initWithCoordinates:coords count:count]; } -- (mbgl::ShapeAnnotation)shapeAnnotationObjectWithDelegate:(id <MGLMultiPointDelegate>)delegate { - mbgl::LineAnnotationProperties lineProperties; - lineProperties.opacity = [delegate alphaForShapeAnnotation:self]; - lineProperties.color = [delegate strokeColorForShapeAnnotation:self]; - lineProperties.width = [delegate lineWidthForPolylineAnnotation:self]; - +- (mbgl::Annotation)annotationObjectWithDelegate:(id <MGLMultiPointDelegate>)delegate { NSUInteger count = self.pointCount; CLLocationCoordinate2D *coordinates = self.coordinates; @@ -28,7 +23,12 @@ geometry.push_back(mbgl::Point<double>(coordinates[i].longitude, coordinates[i].latitude)); } - return mbgl::ShapeAnnotation(geometry, lineProperties); + mbgl::LineAnnotation annotation { geometry }; + annotation.opacity = [delegate alphaForShapeAnnotation:self]; + annotation.color = [delegate strokeColorForShapeAnnotation:self]; + annotation.width = [delegate lineWidthForPolylineAnnotation:self]; + + return annotation; } @end |