Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit c53610f

Browse files
committed
Merge pull request #1854 from mapbox/1ec5-symbol-exception-1851
fixes #1851: assert if -mapView:symbolNameForAnnotation: is implemented
2 parents 1fbbedd + 8a97145 commit c53610f

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

include/mbgl/ios/MGLMapView.h

-4
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,6 @@ IB_DESIGNABLE
345345

346346
/** @name Managing the Display of Annotations */
347347

348-
/** Returns the style's symbol name to use for the marker for the specified point annotation object.
349-
* @param mapView The map view that requested the annotation symbol name.
350-
* @param annotation The object representing the annotation that is about to be displayed.
351-
* @return The marker symbol to display for the specified annotation or `nil` if you want to display the default symbol. */
352348
- (nullable NSString *)mapView:(MGLMapView *)mapView symbolNameForAnnotation:(id <MGLAnnotation>)annotation __attribute__((unavailable("Use -mapView:imageForAnnotation:.")));
353349

354350
/** Returns an image object to use for the marker for the specified point annotation object.

platform/ios/MGLMapView.mm

+8
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,14 @@ - (void)setDelegate:(nullable id<MGLMapViewDelegate>)delegate
455455
if (_delegate == delegate) return;
456456

457457
_delegate = delegate;
458+
459+
if ([delegate respondsToSelector:@selector(mapView:symbolNameForAnnotation:)])
460+
{
461+
[NSException raise:@"Method unavailable" format:
462+
@"-mapView:symbolNameForAnnotation: has been removed from the MGLMapViewDelegate protocol, but %@ still implements it. "
463+
@"Implement -[%@ mapView:imageForAnnotation:] instead.",
464+
NSStringFromClass([delegate class]), NSStringFromClass([delegate class])];
465+
}
458466
}
459467

460468
#pragma mark - Layout -

0 commit comments

Comments
 (0)