diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2019-04-28 17:23:23 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2019-05-07 22:04:48 -0700 |
commit | 910639168aaad8f06749c5be184ae50dbe9d566b (patch) | |
tree | 9bd1642efe2c9ed65b51a8a317602975b7c5c73f /platform/ios/app/MBXViewController.m | |
parent | 84a11ba4e5a6c64edd63b81d606e2ae57862c798 (diff) | |
download | qtlocation-mapboxgl-910639168aaad8f06749c5be184ae50dbe9d566b.tar.gz |
[ios, macos] Added circle geometryupstream/1ec5-circle-2167
Added an MGLCircle class that generates a many-sided polygon under the hood.
Diffstat (limited to 'platform/ios/app/MBXViewController.m')
-rw-r--r-- | platform/ios/app/MBXViewController.m | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index 3335606f98..f98ee1244d 100644 --- a/platform/ios/app/MBXViewController.m +++ b/platform/ios/app/MBXViewController.m @@ -2128,9 +2128,13 @@ CLLocationCoordinate2D randomWorldCoordinate() { return [color colorWithAlphaComponent:0.9]; } -- (UIColor *)mapView:(__unused MGLMapView *)mapView fillColorForPolygonAnnotation:(__unused MGLPolygon *)annotation +- (UIColor *)mapView:(__unused MGLMapView *)mapView fillColorForShape:(MGLShape *)shape { - UIColor *color = annotation.pointCount > 3 ? [UIColor greenColor] : [UIColor redColor]; + UIColor *color = [UIColor redColor]; + if ([shape isKindOfClass:[MGLPolygon class]] && [(MGLPolygon *)shape pointCount] > 3) + { + color = [UIColor greenColor]; + } return [color colorWithAlphaComponent:0.5]; } |