[ios] Deprecated -[MGLMapView emptyMemoryCache]

Deprecated -[MGLMapView emptyMemoryCache]. Switched ios-bench to a redeclared -didReceiveMemoryWarning as a workaround.

Fixes #1833.
This commit is contained in:
Minh Nguyễn
2016-04-17 23:46:46 -07:00
committed by Minh Nguyễn
parent 1818576fe6
commit d86e7323cc
4 changed files with 15 additions and 19 deletions

View File

@@ -12,6 +12,7 @@ Mapbox welcomes participation and contributions from everyone. If you’d like
- Added a `-reloadStyle:` action to MGLMapView to force a reload of the current style. ([#4728](https://github.com/mapbox/mapbox-gl-native/pull/4728))
- A more specific user agent string is now sent with style and tile requests. ([#4012](https://github.com/mapbox/mapbox-gl-native/pull/4012))
- Removed unused SVG files from the SDK’s resource bundle. ([#4641](https://github.com/mapbox/mapbox-gl-native/pull/4641))
- Deprecated `-[MGLMapView emptyMemoryCache]`. ([#4725](https://github.com/mapbox/mapbox-gl-native/pull/4725))
## 3.2.0

View File

@@ -159,7 +159,6 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = {
((debugMask & MGLMapDebugCollisionBoxesMask)
? @"Hide Collision Boxes"
: @"Show Collision Boxes"),
@"Empty Memory",
@"Add 100 Points",
@"Add 1,000 Points",
@"Add 10,000 Points",
@@ -201,21 +200,17 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = {
}
else if (buttonIndex == actionSheet.firstOtherButtonIndex + 5)
{
[self.mapView emptyMemoryCache];
[self parseFeaturesAddingCount:100];
}
else if (buttonIndex == actionSheet.firstOtherButtonIndex + 6)
{
[self parseFeaturesAddingCount:100];
[self parseFeaturesAddingCount:1000];
}
else if (buttonIndex == actionSheet.firstOtherButtonIndex + 7)
{
[self parseFeaturesAddingCount:1000];
}
else if (buttonIndex == actionSheet.firstOtherButtonIndex + 8)
{
[self parseFeaturesAddingCount:10000];
}
else if (buttonIndex == actionSheet.firstOtherButtonIndex + 9)
else if (buttonIndex == actionSheet.firstOtherButtonIndex + 8)
{
// PNW triangle
//
@@ -282,19 +277,19 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = {
free(polygonCoordinates);
}
}
else if (buttonIndex == actionSheet.firstOtherButtonIndex + 10)
else if (buttonIndex == actionSheet.firstOtherButtonIndex + 9)
{
[self startWorldTour:actionSheet];
}
else if (buttonIndex == actionSheet.firstOtherButtonIndex + 11)
else if (buttonIndex == actionSheet.firstOtherButtonIndex + 10)
{
[self presentAnnotationWithCustomCallout];
}
else if (buttonIndex == actionSheet.firstOtherButtonIndex + 12)
else if (buttonIndex == actionSheet.firstOtherButtonIndex + 11)
{
[self.mapView removeAnnotations:self.mapView.annotations];
}
else if (buttonIndex == actionSheet.firstOtherButtonIndex + 13)
else if (buttonIndex == actionSheet.firstOtherButtonIndex + 12)
{
if (_isShowingCustomStyleLayer)
{
@@ -305,12 +300,12 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = {
[self insertCustomStyleLayer];
}
}
else if (buttonIndex == actionSheet.firstOtherButtonIndex + 14)
else if (buttonIndex == actionSheet.firstOtherButtonIndex + 13)
{
NSString *fileContents = [NSString stringWithContentsOfFile:[self telemetryDebugLogfilePath] encoding:NSUTF8StringEncoding error:nil];
NSLog(@"%@", fileContents);
}
else if (buttonIndex == actionSheet.firstOtherButtonIndex + 15)
else if (buttonIndex == actionSheet.firstOtherButtonIndex + 14)
{
NSString *filePath = [self telemetryDebugLogfilePath];
if ([[NSFileManager defaultManager] isDeletableFileAtPath:filePath]) {

View File

@@ -16,6 +16,9 @@
/** Returns whether the map view is currently loading or processing any assets required to render the map */
- (BOOL)isFullyLoaded;
/** Empties the in-memory tile cache. */
- (void)didReceiveMemoryWarning;
@end
@interface MBXBenchViewController () <MGLMapViewDelegate>
@@ -142,7 +145,7 @@ static const int benchmarkDuration = 200; // frames
{
// Start the benchmarking timer.
state = State::WarmingUp;
[self.mapView emptyMemoryCache];
[self.mapView didReceiveMemoryWarning];
NSLog(@"- Warming up for %d frames...", warmupDuration);
[mapView setNeedsGLDisplay];
}

View File

@@ -989,10 +989,7 @@ IB_DESIGNABLE
- (void)toggleDebug __attribute__((deprecated("Use -setDebugMask:.")));
/**
Empties the in-memory tile cache.
*/
- (void)emptyMemoryCache;
- (void)emptyMemoryCache __attribute__((deprecated));
/**
Resets the map to the minimum zoom level, a center coordinate of (0, 0), and