Merge pull request #1854 from mapbox/1ec5-symbol-exception-1851

fixes #1851: assert if -mapView:symbolNameForAnnotation: is implemented
This commit is contained in:
Justin R. Miller
2015-07-08 14:31:35 -07:00
2 changed files with 8 additions and 4 deletions

View File

@@ -345,10 +345,6 @@ IB_DESIGNABLE
/** @name Managing the Display of Annotations */
/** Returns the style's symbol name to use for the marker for the specified point annotation object.
* @param mapView The map view that requested the annotation symbol name.
* @param annotation The object representing the annotation that is about to be displayed.
* @return The marker symbol to display for the specified annotation or `nil` if you want to display the default symbol. */
- (nullable NSString *)mapView:(MGLMapView *)mapView symbolNameForAnnotation:(id <MGLAnnotation>)annotation __attribute__((unavailable("Use -mapView:imageForAnnotation:.")));
/** Returns an image object to use for the marker for the specified point annotation object.

View File

@@ -455,6 +455,14 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
if (_delegate == delegate) return;
_delegate = delegate;
if ([delegate respondsToSelector:@selector(mapView:symbolNameForAnnotation:)])
{
[NSException raise:@"Method unavailable" format:
@"-mapView:symbolNameForAnnotation: has been removed from the MGLMapViewDelegate protocol, but %@ still implements it. "
@"Implement -[%@ mapView:imageForAnnotation:] instead.",
NSStringFromClass([delegate class]), NSStringFromClass([delegate class])];
}
}
#pragma mark - Layout -