[ios,macos] Update {Line,Fill}Annotation properties setter

This commit is contained in:
Bruno de Oliveira Abinader
2016-07-12 18:48:38 +03:00
parent 761c9d44b2
commit 06af750d23
7 changed files with 18 additions and 18 deletions

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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