Authored by Obrand69

Simplified region delegate signature and made it retainable

@@ -92,7 +92,7 @@ enum { @@ -92,7 +92,7 @@ enum {
92 @property (retain, readwrite) RMMapLayer *background; 92 @property (retain, readwrite) RMMapLayer *background;
93 @property (retain, readwrite) RMLayerSet *overlay; 93 @property (retain, readwrite) RMLayerSet *overlay;
94 @property (retain, readonly) RMMarkerManager *markerManager; 94 @property (retain, readonly) RMMarkerManager *markerManager;
95 -@property (assign) id<RMTilesUpdateDelegate> tilesUpdateDelegate; 95 +@property (nonatomic, retain) id<RMTilesUpdateDelegate> tilesUpdateDelegate;
96 @property (readwrite) NSUInteger boundingMask; 96 @property (readwrite) NSUInteger boundingMask;
97 97
98 - (id) initForView: (UIView*) view; 98 - (id) initForView: (UIView*) view;
@@ -625,12 +625,7 @@ static BOOL _performExpensiveOperations = YES; @@ -625,12 +625,7 @@ static BOOL _performExpensiveOperations = YES;
625 if(delegateHasRegionUpdate) 625 if(delegateHasRegionUpdate)
626 { 626 {
627 RMLatLongBounds locationBounds = [self getCoordinateBounds:region]; 627 RMLatLongBounds locationBounds = [self getCoordinateBounds:region];
628 - NSLog(@"===> AFTER CONVERSION - BOUNDS: NW Lat: %lf NW Lon:%lf SW Lat:%lf SW Lon:%lf",  
629 - locationBounds.northWest.latitude,locationBounds.northWest.longitude,  
630 - locationBounds.southEast.latitude, locationBounds.southEast.longitude);  
631 -  
632 - [tilesUpdateDelegate regionUpdate:locationBounds.northWest.latitude NWLon:locationBounds.northWest.longitude  
633 - SELat:locationBounds.southEast.latitude SELon:locationBounds.southEast.longitude]; 628 + [tilesUpdateDelegate regionUpdate:locationBounds];
634 } 629 }
635 } 630 }
636 - (void) printDebuggingInformation 631 - (void) printDebuggingInformation
@@ -644,8 +639,8 @@ static BOOL _performExpensiveOperations = YES; @@ -644,8 +639,8 @@ static BOOL _performExpensiveOperations = YES;
644 { 639 {
645 if (tilesUpdateDelegate == _tilesUpdateDelegate) return; 640 if (tilesUpdateDelegate == _tilesUpdateDelegate) return;
646 tilesUpdateDelegate= _tilesUpdateDelegate; 641 tilesUpdateDelegate= _tilesUpdateDelegate;
647 -  
648 - delegateHasRegionUpdate = [(NSObject*) tilesUpdateDelegate respondsToSelector: @selector(regionUpdate: NWLon: SELat: SELon:)]; 642 + //NSLog(@"Delegate type:%@",[(NSObject *) tilesUpdateDelegate description]);
  643 + delegateHasRegionUpdate = [(NSObject*) tilesUpdateDelegate respondsToSelector: @selector(regionUpdate:)];
649 } 644 }
650 645
651 - (id<RMTilesUpdateDelegate>) tilesUpdateDelegate 646 - (id<RMTilesUpdateDelegate>) tilesUpdateDelegate
@@ -12,6 +12,6 @@ @@ -12,6 +12,6 @@
12 12
13 @required 13 @required
14 14
15 -- (void) regionUpdate: (double) northWestLatitude NWLon:(double) northWestLongitude SELat:(double) southEastLatitude SELon:(double) southEastLongitude; 15 +- (void) regionUpdate: (RMLatLongBounds) region;
16 16
17 @end 17 @end