summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2016-07-12 18:48:38 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2016-07-13 11:57:09 +0300
commit06af750d236861e32d047f8cfdb0b766bd174f67 (patch)
tree239c57101e80363b8cda7d750fe8374ba9cc26d5
parent761c9d44b28f8d0f5fed3c476ce8b2636c4dafcc (diff)
downloadqtlocation-mapboxgl-06af750d236861e32d047f8cfdb0b766bd174f67.tar.gz
[ios,macos] Update {Line,Fill}Annotation properties setter
-rw-r--r--platform/darwin/src/MGLMultiPoint_Private.h4
-rw-r--r--platform/darwin/src/MGLPolygon.mm6
-rw-r--r--platform/darwin/src/MGLPolyline.mm6
-rw-r--r--platform/ios/src/MGLMapView.mm8
-rw-r--r--platform/ios/src/MGLMapViewDelegate.h2
-rw-r--r--platform/macos/src/MGLMapView.mm8
-rw-r--r--platform/macos/src/MGLMapViewDelegate.h2
7 files changed, 18 insertions, 18 deletions
diff --git a/platform/darwin/src/MGLMultiPoint_Private.h b/platform/darwin/src/MGLMultiPoint_Private.h
index aa52a02fcb..3da4c0bbb5 100644
--- a/platform/darwin/src/MGLMultiPoint_Private.h
+++ b/platform/darwin/src/MGLMultiPoint_Private.h
@@ -30,7 +30,7 @@ NS_ASSUME_NONNULL_BEGIN
@protocol MGLMultiPointDelegate <NSObject>
/** Returns the fill alpha value for the given annotation. */
-- (double)alphaForShapeAnnotation:(MGLShape *)annotation;
+- (float)alphaForShapeAnnotation:(MGLShape *)annotation;
/** Returns the stroke color object for the given annotation. */
- (mbgl::Color)strokeColorForShapeAnnotation:(MGLShape *)annotation;
@@ -39,7 +39,7 @@ NS_ASSUME_NONNULL_BEGIN
- (mbgl::Color)fillColorForPolygonAnnotation:(MGLPolygon *)annotation;
/** Returns the stroke width object for the given annotation. */
-- (CGFloat)lineWidthForPolylineAnnotation:(MGLPolyline *)annotation;
+- (float)lineWidthForPolylineAnnotation:(MGLPolyline *)annotation;
@end
diff --git a/platform/darwin/src/MGLPolygon.mm b/platform/darwin/src/MGLPolygon.mm
index c009d9e3d6..3829adf675 100644
--- a/platform/darwin/src/MGLPolygon.mm
+++ b/platform/darwin/src/MGLPolygon.mm
@@ -44,9 +44,9 @@
}
mbgl::FillAnnotation annotation { geometry };
- annotation.opacity = [delegate alphaForShapeAnnotation:self];
- annotation.outlineColor = [delegate strokeColorForShapeAnnotation:self];
- annotation.color = [delegate fillColorForPolygonAnnotation:self];
+ annotation.opacity = { [delegate alphaForShapeAnnotation:self] };
+ annotation.outlineColor = { [delegate strokeColorForShapeAnnotation:self] };
+ annotation.color = { [delegate fillColorForPolygonAnnotation:self] };
return annotation;
}
diff --git a/platform/darwin/src/MGLPolyline.mm b/platform/darwin/src/MGLPolyline.mm
index 15ea5a0952..9f6f6c3542 100644
--- a/platform/darwin/src/MGLPolyline.mm
+++ b/platform/darwin/src/MGLPolyline.mm
@@ -24,9 +24,9 @@
}
mbgl::LineAnnotation annotation { geometry };
- annotation.opacity = [delegate alphaForShapeAnnotation:self];
- annotation.color = [delegate strokeColorForShapeAnnotation:self];
- annotation.width = [delegate lineWidthForPolylineAnnotation:self];
+ annotation.opacity = { [delegate alphaForShapeAnnotation:self] };
+ annotation.color = { [delegate strokeColorForShapeAnnotation:self] };
+ annotation.width = { [delegate lineWidthForPolylineAnnotation:self] };
return annotation;
}
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index 28b030b7dd..858ea11a98 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -3033,13 +3033,13 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration)
return annotationContext.annotationView;
}
-- (double)alphaForShapeAnnotation:(MGLShape *)annotation
+- (float)alphaForShapeAnnotation:(MGLShape *)annotation
{
if (_delegateHasAlphasForShapeAnnotations)
{
return [self.delegate mapView:self alphaForShapeAnnotation:annotation];
}
- return 1.0;
+ return 1.0f;
}
- (mbgl::Color)strokeColorForShapeAnnotation:(MGLShape *)annotation
@@ -3058,13 +3058,13 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration)
return MGLColorObjectFromUIColor(color);
}
-- (CGFloat)lineWidthForPolylineAnnotation:(MGLPolyline *)annotation
+- (float)lineWidthForPolylineAnnotation:(MGLPolyline *)annotation
{
if (_delegateHasLineWidthsForShapeAnnotations)
{
return [self.delegate mapView:self lineWidthForPolylineAnnotation:(MGLPolyline *)annotation];
}
- return 3.0;
+ return 3.0f;
}
- (void)installAnnotationImage:(MGLAnnotationImage *)annotationImage
diff --git a/platform/ios/src/MGLMapViewDelegate.h b/platform/ios/src/MGLMapViewDelegate.h
index 12a0658a51..ed698462c7 100644
--- a/platform/ios/src/MGLMapViewDelegate.h
+++ b/platform/ios/src/MGLMapViewDelegate.h
@@ -247,7 +247,7 @@ NS_ASSUME_NONNULL_BEGIN
@param annotation The annotation being rendered.
@return A line width for the polyline, measured in points.
*/
-- (CGFloat)mapView:(MGLMapView *)mapView lineWidthForPolylineAnnotation:(MGLPolyline *)annotation;
+- (float)mapView:(MGLMapView *)mapView lineWidthForPolylineAnnotation:(MGLPolyline *)annotation;
#pragma mark Managing Annotation Views
diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm
index 5785f56e01..91cd385638 100644
--- a/platform/macos/src/MGLMapView.mm
+++ b/platform/macos/src/MGLMapView.mm
@@ -2097,11 +2097,11 @@ public:
#pragma mark MGLMultiPointDelegate methods
-- (double)alphaForShapeAnnotation:(MGLShape *)annotation {
+- (float)alphaForShapeAnnotation:(MGLShape *)annotation {
if (_delegateHasAlphasForShapeAnnotations) {
return [self.delegate mapView:self alphaForShapeAnnotation:annotation];
}
- return 1.0;
+ return 1.0f;
}
- (mbgl::Color)strokeColorForShapeAnnotation:(MGLShape *)annotation {
@@ -2118,11 +2118,11 @@ public:
return MGLColorObjectFromNSColor(color);
}
-- (CGFloat)lineWidthForPolylineAnnotation:(MGLPolyline *)annotation {
+- (float)lineWidthForPolylineAnnotation:(MGLPolyline *)annotation {
if (_delegateHasLineWidthsForShapeAnnotations) {
return [self.delegate mapView:self lineWidthForPolylineAnnotation:(MGLPolyline *)annotation];
}
- return 3.0;
+ return 3.0f;
}
#pragma mark MGLPopoverDelegate methods
diff --git a/platform/macos/src/MGLMapViewDelegate.h b/platform/macos/src/MGLMapViewDelegate.h
index 6ea69f845a..048cd0b62d 100644
--- a/platform/macos/src/MGLMapViewDelegate.h
+++ b/platform/macos/src/MGLMapViewDelegate.h
@@ -174,7 +174,7 @@ NS_ASSUME_NONNULL_BEGIN
@param annotation The annotation being rendered.
@return A line width for the polyline, measured in points.
*/
-- (CGFloat)mapView:(MGLMapView *)mapView lineWidthForPolylineAnnotation:(MGLPolyline *)annotation;
+- (float)mapView:(MGLMapView *)mapView lineWidthForPolylineAnnotation:(MGLPolyline *)annotation;
#pragma mark Selecting Annotations