diff options
author | jmkiley <jordan.kiley@mapbox.com> | 2019-05-28 16:21:49 -0700 |
---|---|---|
committer | jmkiley <jordan.kiley@mapbox.com> | 2019-05-28 16:21:49 -0700 |
commit | be0f06fb0fc22f8aa32ee22dd28c396439ddee92 (patch) | |
tree | c1d17b340c85bd56938c2f4a21da762275825605 | |
parent | 8ade7e8725f7e10c80bb4d8005546962d2b7af0c (diff) | |
download | qtlocation-mapboxgl-upstream/jmkiley-repro-14779.tar.gz |
[ios] Reaotation layer r not necessaryupstream/jmkiley-repro-14779
-rw-r--r-- | platform/ios/app/MBXViewController.m | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index f05b696a1c..b38646b62a 100644 --- a/platform/ios/app/MBXViewController.m +++ b/platform/ios/app/MBXViewController.m @@ -1067,25 +1067,24 @@ CLLocationCoordinate2D randomWorldCoordinate() { } } + // Create array of coordinates. CLLocationCoordinate2D visibleCoordinates[4] = { self.mapView.visibleCoordinateBounds.ne, CLLocationCoordinate2DMake(self.mapView.visibleCoordinateBounds.ne.latitude, self.mapView.visibleCoordinateBounds.sw.longitude), self.mapView.visibleCoordinateBounds.sw, CLLocationCoordinate2DMake(self.mapView.visibleCoordinateBounds.sw.latitude, self.mapView.visibleCoordinateBounds.ne.longitude) }; + NSUInteger numberOfCoordinates = sizeof(visibleCoordinates) / sizeof(CLLocationCoordinate2D); MGLPolygon *shape = [MGLPolygon polygonWithCoordinates:visibleCoordinates count:numberOfCoordinates]; + MGLShapeSource *shapeSource = [[MGLShapeSource alloc] initWithIdentifier:@"visible-coord" shape:shape options:nil]; [self.mapView.style addSource:shapeSource]; MGLFillStyleLayer *shapeLayer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"visible-coord" source:shapeSource]; shapeLayer.fillOpacity = [NSExpression expressionForConstantValue:@0.5]; - MGLStyleLayer *annotLayer = [self.mapView.style layerWithIdentifier:@"com.mapbox.annotations.points"]; - if (annotLayer) { - [self.mapView.style insertLayer:shapeLayer belowLayer:annotLayer]; - } else { - [self.mapView.style addLayer:shapeLayer]; - } + + [self.mapView.style addLayer:shapeLayer]; } - (void)styleWaterLayer |