summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-04-17 23:46:46 -0700
committerMinh Nguyễn <mxn@1ec5.org>2016-04-18 15:45:27 -0700
commitd86e7323cc85a2e9038af71047dbf577c35d80b5 (patch)
tree18724acf1247848c0d949d9843619df3bb3b8870 /platform
parent1818576fe699f2fc8d63266b0b64c8a743592fbc (diff)
downloadqtlocation-mapboxgl-d86e7323cc85a2e9038af71047dbf577c35d80b5.tar.gz
[ios] Deprecated -[MGLMapView emptyMemoryCache]
Deprecated -[MGLMapView emptyMemoryCache]. Switched ios-bench to a redeclared -didReceiveMemoryWarning as a workaround. Fixes #1833.
Diffstat (limited to 'platform')
-rw-r--r--platform/ios/CHANGELOG.md1
-rw-r--r--platform/ios/app/MBXViewController.m23
-rw-r--r--platform/ios/benchmark/MBXBenchViewController.mm5
-rw-r--r--platform/ios/include/MGLMapView.h5
4 files changed, 15 insertions, 19 deletions
diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md
index b9a5c7f157..329117394f 100644
--- a/platform/ios/CHANGELOG.md
+++ b/platform/ios/CHANGELOG.md
@@ -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
diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m
index 55ced81319..45fc94ffa6 100644
--- a/platform/ios/app/MBXViewController.m
+++ b/platform/ios/app/MBXViewController.m
@@ -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];
- }
- else if (buttonIndex == actionSheet.firstOtherButtonIndex + 6)
- {
[self parseFeaturesAddingCount:100];
}
- else if (buttonIndex == actionSheet.firstOtherButtonIndex + 7)
+ else if (buttonIndex == actionSheet.firstOtherButtonIndex + 6)
{
[self parseFeaturesAddingCount:1000];
}
- else if (buttonIndex == actionSheet.firstOtherButtonIndex + 8)
+ else if (buttonIndex == actionSheet.firstOtherButtonIndex + 7)
{
[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]) {
diff --git a/platform/ios/benchmark/MBXBenchViewController.mm b/platform/ios/benchmark/MBXBenchViewController.mm
index 07975de491..5768872160 100644
--- a/platform/ios/benchmark/MBXBenchViewController.mm
+++ b/platform/ios/benchmark/MBXBenchViewController.mm
@@ -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];
}
diff --git a/platform/ios/include/MGLMapView.h b/platform/ios/include/MGLMapView.h
index c2d6bce4ee..79897f0eb5 100644
--- a/platform/ios/include/MGLMapView.h
+++ b/platform/ios/include/MGLMapView.h
@@ -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