fixes #1907: skip MGLPolyline/MGLPolygons with zero points
This commit is contained in:
@@ -1828,6 +1828,10 @@ CLLocationCoordinate2D MGLLocationCoordinate2DFromLatLng(mbgl::LatLng latLng)
|
||||
|
||||
if ([annotation isKindOfClass:[MGLMultiPoint class]])
|
||||
{
|
||||
NSUInteger count = [(MGLMultiPoint *)annotation pointCount];
|
||||
|
||||
if (count == 0) break;
|
||||
|
||||
CGFloat alpha = (delegateImplementsAlphaForShape ?
|
||||
[self.delegate mapView:self alphaForShapeAnnotation:annotation] :
|
||||
1.0);
|
||||
@@ -1881,8 +1885,6 @@ CLLocationCoordinate2D MGLLocationCoordinate2DFromLatLng(mbgl::LatLng latLng)
|
||||
userInfo:nil] raise];
|
||||
}
|
||||
|
||||
NSUInteger count = [(MGLMultiPoint *)annotation pointCount];
|
||||
|
||||
CLLocationCoordinate2D *coordinates = (CLLocationCoordinate2D *)malloc(count * sizeof(CLLocationCoordinate2D));
|
||||
[(MGLMultiPoint *)annotation getCoordinates:coordinates range:NSMakeRange(0, count)];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user