...
|
...
|
@@ -17,6 +17,8 @@ |
|
|
|
|
|
#import "RMTileCache.h"
|
|
|
|
|
|
NSString * const RMMapNewTilesBoundsNotification = @"NewTilesBounds";
|
|
|
|
|
|
NSString* const RMMapImageRemovedFromScreenNotification = @"RMMapImageRemovedFromScreen";
|
|
|
NSString* const RMMapImageAddedToScreenNotification = @"RMMapImageAddedToScreen";
|
|
|
|
...
|
...
|
@@ -98,6 +100,31 @@ NSString* const RMResumeExpensiveOperations = @"RMResumeExpensiveOperations"; |
|
|
RMTileImageSet *images = [content imagesOnScreen];
|
|
|
CGRect newLoadedBounds = [images addTiles:newTileRect ToDisplayIn:[content screenBounds]];
|
|
|
|
|
|
//NSLog(@"===> TILES LOADED. X:%lf Y:%lf WIDTH:%lf HEIGHT:%lf",newLoadedBounds.origin.x, newLoadedBounds.origin.y, newLoadedBounds.size.width, newLoadedBounds.size.height);
|
|
|
|
|
|
CLLocationCoordinate2DBounds locationBounds = [content getCoordinateBounds:newLoadedBounds];
|
|
|
|
|
|
//NSLog(@"===> AFTER CONVERSION - BOUNDS: NW Lat: %lf NW Lon:%lf SW Lat:%lf SW Lon:%lf",
|
|
|
// locationBounds.northWest.latitude,locationBounds.northWest.longitude,
|
|
|
// locationBounds.southEast.latitude, locationBounds.southEast.longitude);
|
|
|
|
|
|
CLLocation *NWLocation = [[CLLocation alloc] initWithLatitude:locationBounds.northWest.latitude longitude:locationBounds.northWest.longitude];
|
|
|
CLLocation *SELocation = [[CLLocation alloc] initWithLatitude:locationBounds.southEast.latitude longitude:locationBounds.southEast.longitude];
|
|
|
|
|
|
NSArray *keys = [NSArray arrayWithObjects:@"NWBounds", @"SEBounds", nil];
|
|
|
NSArray *objects = [NSArray arrayWithObjects:NWLocation, SELocation, nil];
|
|
|
NSDictionary *tilesBounds = [NSDictionary dictionaryWithObjects:objects forKeys:keys];
|
|
|
|
|
|
[NWLocation release];
|
|
|
[SELocation release];
|
|
|
|
|
|
// Send notification
|
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:RMMapNewTilesBoundsNotification
|
|
|
object:self
|
|
|
userInfo:tilesBounds];
|
|
|
|
|
|
|
|
|
|
|
|
if (!RMTileIsDummy(loadedTiles.origin.tile))
|
|
|
[images removeTiles:loadedTiles];
|
|
|
|
...
|
...
|
|