Authored by Obrand69

Simplified region delegate signature and made it retainable

... ... @@ -92,7 +92,7 @@ enum {
@property (retain, readwrite) RMMapLayer *background;
@property (retain, readwrite) RMLayerSet *overlay;
@property (retain, readonly) RMMarkerManager *markerManager;
@property (assign) id<RMTilesUpdateDelegate> tilesUpdateDelegate;
@property (nonatomic, retain) id<RMTilesUpdateDelegate> tilesUpdateDelegate;
@property (readwrite) NSUInteger boundingMask;
- (id) initForView: (UIView*) view;
... ...
... ... @@ -625,12 +625,7 @@ static BOOL _performExpensiveOperations = YES;
if(delegateHasRegionUpdate)
{
RMLatLongBounds locationBounds = [self getCoordinateBounds:region];
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);
[tilesUpdateDelegate regionUpdate:locationBounds.northWest.latitude NWLon:locationBounds.northWest.longitude
SELat:locationBounds.southEast.latitude SELon:locationBounds.southEast.longitude];
[tilesUpdateDelegate regionUpdate:locationBounds];
}
}
- (void) printDebuggingInformation
... ... @@ -644,8 +639,8 @@ static BOOL _performExpensiveOperations = YES;
{
if (tilesUpdateDelegate == _tilesUpdateDelegate) return;
tilesUpdateDelegate= _tilesUpdateDelegate;
delegateHasRegionUpdate = [(NSObject*) tilesUpdateDelegate respondsToSelector: @selector(regionUpdate: NWLon: SELat: SELon:)];
//NSLog(@"Delegate type:%@",[(NSObject *) tilesUpdateDelegate description]);
delegateHasRegionUpdate = [(NSObject*) tilesUpdateDelegate respondsToSelector: @selector(regionUpdate:)];
}
- (id<RMTilesUpdateDelegate>) tilesUpdateDelegate
... ...
... ... @@ -12,6 +12,6 @@
@required
- (void) regionUpdate: (double) northWestLatitude NWLon:(double) northWestLongitude SELat:(double) southEastLatitude SELon:(double) southEastLongitude;
- (void) regionUpdate: (RMLatLongBounds) region;
@end
... ...