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

Deprecate -[MGLMapView emptyMemoryCache] #4725

Merged
merged 2 commits into from
Apr 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions platform/ios/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
23 changes: 9 additions & 14 deletions platform/ios/app/MBXViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ - (IBAction)showSettings:(__unused id)sender
((debugMask & MGLMapDebugCollisionBoxesMask)
? @"Hide Collision Boxes"
: @"Show Collision Boxes"),
@"Empty Memory",
@"Add 100 Points",
@"Add 1,000 Points",
@"Add 10,000 Points",
Expand Down Expand Up @@ -200,22 +199,18 @@ - (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSIn
self.mapView.debugMask ^= MGLMapDebugCollisionBoxesMask;
}
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
//
Expand Down Expand Up @@ -282,19 +277,19 @@ - (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSIn
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)
{
Expand All @@ -305,12 +300,12 @@ - (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSIn
[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]) {
Expand Down
15 changes: 2 additions & 13 deletions platform/ios/benchmark/MBXBenchViewController.mm
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
#import "MBXBenchViewController.h"

#import <Mapbox/Mapbox.h>
#import "MGLMapView_Internal.h"

#include "locations.hpp"

#include <chrono>

@interface MGLMapView (MBXBenchmarkAdditions)

#pragma mark - Debugging

/** Triggers another render pass even when it is not necessary. */
- (void)setNeedsGLDisplay;

/** Returns whether the map view is currently loading or processing any assets required to render the map */
- (BOOL)isFullyLoaded;

@end

@interface MBXBenchViewController () <MGLMapViewDelegate>

@property (nonatomic) MGLMapView *mapView;
Expand Down Expand Up @@ -142,7 +131,7 @@ - (void)mapViewDidFinishRenderingFrame:(MGLMapView *)mapView fullyRendered:(__un
{
// Start the benchmarking timer.
state = State::WarmingUp;
[self.mapView emptyMemoryCache];
[self.mapView didReceiveMemoryWarning];
NSLog(@"- Warming up for %d frames...", warmupDuration);
[mapView setNeedsGLDisplay];
}
Expand Down
5 changes: 1 addition & 4 deletions platform/ios/include/MGLMapView.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions platform/ios/ios.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
objects = {

/* Begin PBXBuildFile section */
DA17BE301CC4BAC300402C41 /* MGLMapView_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = DA17BE2F1CC4BAC300402C41 /* MGLMapView_Internal.h */; };
DA17BE311CC4BDAA00402C41 /* MGLMapView_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = DA17BE2F1CC4BAC300402C41 /* MGLMapView_Internal.h */; };
DA1DC96A1CB6C6B7006E619F /* MBXCustomCalloutView.m in Sources */ = {isa = PBXBuildFile; fileRef = DA1DC9671CB6C6B7006E619F /* MBXCustomCalloutView.m */; };
DA1DC96B1CB6C6B7006E619F /* MBXOfflinePacksTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA1DC9691CB6C6B7006E619F /* MBXOfflinePacksTableViewController.m */; };
DA1DC9701CB6C6CE006E619F /* points.geojson in Resources */ = {isa = PBXBuildFile; fileRef = DA1DC96C1CB6C6CE006E619F /* points.geojson */; };
Expand Down Expand Up @@ -239,6 +241,7 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
DA17BE2F1CC4BAC300402C41 /* MGLMapView_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MGLMapView_Internal.h; path = src/MGLMapView_Internal.h; sourceTree = "<group>"; };
DA1DC94A1CB6C1C2006E619F /* Mapbox GL.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Mapbox GL.app"; sourceTree = BUILT_PRODUCTS_DIR; };
DA1DC9501CB6C1C2006E619F /* MBXAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBXAppDelegate.h; sourceTree = "<group>"; };
DA1DC9531CB6C1C2006E619F /* MBXViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBXViewController.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -591,6 +594,7 @@
DA8848481CBAFB9800AB86E3 /* MGLMapboxEvents.h */,
DA8848491CBAFB9800AB86E3 /* MGLMapboxEvents.m */,
DA8848361CBAFB8500AB86E3 /* MGLMapView.h */,
DA17BE2F1CC4BAC300402C41 /* MGLMapView_Internal.h */,
DA8848371CBAFB8500AB86E3 /* MGLMapView+IBAdditions.h */,
DA8848381CBAFB8500AB86E3 /* MGLMapView+MGLCustomStyleLayerAdditions.h */,
DA88484A1CBAFB9800AB86E3 /* MGLMapView.mm */,
Expand Down Expand Up @@ -735,6 +739,7 @@
DA8848551CBAFB9800AB86E3 /* MGLLocationManager.h in Headers */,
DA88483F1CBAFB8500AB86E3 /* MGLUserLocation.h in Headers */,
DA88483D1CBAFB8500AB86E3 /* MGLMapView+IBAdditions.h in Headers */,
DA17BE301CC4BAC300402C41 /* MGLMapView_Internal.h in Headers */,
DA88481E1CBAFA6200AB86E3 /* MGLMultiPoint_Private.h in Headers */,
DA8847F71CBAFA5100AB86E3 /* MGLOverlay.h in Headers */,
DA88488B1CBB037E00AB86E3 /* SMCalloutView.h in Headers */,
Expand Down Expand Up @@ -772,6 +777,7 @@
DABFB8721CBE9A0F00D62B32 /* MGLUserLocation.h in Headers */,
DABFB8661CBE99E500D62B32 /* MGLPointAnnotation.h in Headers */,
DABFB8621CBE99E500D62B32 /* MGLOfflinePack.h in Headers */,
DA17BE311CC4BDAA00402C41 /* MGLMapView_Internal.h in Headers */,
DABFB86C1CBE99E500D62B32 /* MGLTypes.h in Headers */,
DABFB8691CBE99E500D62B32 /* MGLShape.h in Headers */,
DABFB8701CBE9A0F00D62B32 /* MGLMapView+IBAdditions.h in Headers */,
Expand Down
4 changes: 1 addition & 3 deletions platform/ios/src/MGLMapView.mm
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#import "MGLMapView.h"
#import "MGLMapView+IBAdditions.h"
#import "MGLMapView+MGLCustomStyleLayerAdditions.h"
#import "MGLMapView_Internal.h"

#import <mbgl/platform/log.hpp>
#import <mbgl/gl/gl.hpp>
Expand Down
14 changes: 14 additions & 0 deletions platform/ios/src/MGLMapView_Internal.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#import <Mapbox/Mapbox.h>

@interface MGLMapView (Internal)

/** Triggers another render pass even when it is not necessary. */
- (void)setNeedsGLDisplay;

/** 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