-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[ios] Add removeStyleImage to MGLMapView #14769
Conversation
We should wait for #14763 to land, as it moves a few things around. |
@param mapView The map view that is evicting the image. | ||
@param imageName The image name that is going to be removed. | ||
*/ | ||
- (BOOL)mapView:(MGLMapView *)mapView removeStyleImage:(NSString *)imageName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- (BOOL)mapView:(MGLMapView *)mapView removeStyleImage:(NSString *)imageName; | |
- (BOOL)mapView:(MGLMapView *)mapView shouldRemoveStyleImage:(NSString *)imageName; |
042f9b3
to
12cb77e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - thank you! Let's think about what tests might be relevant here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested changelog entry:
- Added the
-[MGLMapViewDelegate mapView:shouldRemoveStyleImage:]
method for optimizing style image caching. (#14769)
goes over the cache size or when the image's requesting tile is destroyed. | ||
|
||
@param mapView The map view that is evicting the image. | ||
@param imageName The image name that is going to be removed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Document the return value as well. (×2)
Asks the delegate whether the map view should evict cached images. | ||
|
||
This method is called in two scenarios: when the cumulative size of unused images | ||
goes over the cache size or when the image's requesting tile is destroyed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is called in two scenarios: when the cumulative size of unused images exceeds the cache size or when the last tile that includes the image is removed from memory.
(×2)
@@ -333,6 +333,17 @@ NS_ASSUME_NONNULL_BEGIN | |||
*/ | |||
- (nullable NSViewController *)mapView:(MGLMapView *)mapView calloutViewControllerForAnnotation:(id <MGLAnnotation>)annotation; | |||
|
|||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method appears under the “Managing Callout Popovers” heading in the header and in documentation:
#pragma mark Managing Callout Popovers |
Create a new heading for “Managing the Style” or move this method up to the “Loading the Map” section.
@@ -277,6 +277,17 @@ NS_ASSUME_NONNULL_BEGIN | |||
|
|||
- (nullable UIImage *)mapView:(MGLMapView *)mapView didFailToLoadImage:(NSString *)imageName; | |||
|
|||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method appears under the “Managing Callout Views” heading in the header and in documentation:
#pragma mark Managing Callout Views |
Create a new heading for “Managing the Style” or move this method up to the “Loading the Map” section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On iOS is under the right header.
12cb77e
to
0eda0b9
Compare
0eda0b9
to
c24d67b
Compare
Fixes #14731