Authored by Joseph G

Moved marker manager into MapContents. API shouldn't change.

... ... @@ -27,6 +27,7 @@ enum {
RMMapMinWidthBound = 2
};
@class RMMarkerManager;
@class RMProjection;
@class RMMercatorToScreenProjection;
@class RMTileImageSet;
... ... @@ -45,6 +46,7 @@ enum {
// This is the underlying UIView's layer.
CALayer *layer;
RMMarkerManager *markerManager;
RMMapLayer *background;
RMLayerSet *overlay;
... ... @@ -89,6 +91,8 @@ enum {
@property (retain, readwrite) RMMapLayer *background;
@property (retain, readwrite) RMLayerSet *overlay;
@property (retain, readonly) RMMarkerManager *markerManager;
@property (readwrite) NSUInteger boundingMask;
- (id) initForView: (UIView*) view;
... ...
... ... @@ -22,6 +22,7 @@
#import "RMCachedTileSource.h"
#import "RMLayerSet.h"
#import "RMMarkerManager.h"
#import "RMMarker.h"
... ... @@ -30,6 +31,7 @@
@synthesize boundingMask;
@synthesize minZoom;
@synthesize maxZoom;
@synthesize markerManager;
#pragma mark Initialisation
- (id) initForView: (UIView*) view
... ... @@ -93,6 +95,8 @@
[self setOverlay:theOverlay];
[theOverlay release];
markerManager = [[RMMarkerManager alloc] initWithContents:self];
[view setNeedsDisplay];
NSLog(@"Map contents initialised. view: %@ tileSource %@ renderer %@", view, tileSource, renderer);
... ... @@ -110,6 +114,9 @@
[mercatorToScreenProjection release];
[tileSource release];
[layer release];
[overlay release];
[background release];
[markerManager release];
[super dealloc];
}
... ...
... ... @@ -24,8 +24,6 @@ typedef struct {
} RMGestureDetails;
@class RMMapContents;
@class RMMarker;
@class RMMarkerManager;
// This class is a wrapper around RMMapContents for the iphone.
// It implements event handling; but thats about it. All the interesting map
... ... @@ -33,7 +31,6 @@ typedef struct {
@interface RMMapView : UIView
{
RMMapContents *contents;
RMMarkerManager *markerManager;
id<RMMapViewDelegate> delegate;
BOOL enableDragging;
... ...
... ... @@ -28,12 +28,9 @@
@implementation RMMapView
@synthesize markerManager;
-(void) initValues
{
contents = [[RMMapContents alloc] initForView:self];
markerManager = [[RMMarkerManager alloc] initWithContents:contents];
enableDragging = YES;
enableZoom = YES;
... ... @@ -64,7 +61,6 @@
-(void) dealloc
{
[markerManager release];
[contents release];
[super dealloc];
}
... ... @@ -77,7 +73,7 @@
-(NSString*) description
{
CGRect bounds = [self bounds];
return [NSString stringWithFormat:@"iPhone MapView at %.0f,%.0f-%.0f,%.0f", bounds.origin.x, bounds.origin.y, bounds.size.width, bounds.size.height];
return [NSString stringWithFormat:@"MapView at %.0f,%.0f-%.0f,%.0f", bounds.origin.x, bounds.origin.y, bounds.size.width, bounds.size.height];
}
-(RMMapContents*) contents
... ... @@ -337,11 +333,14 @@
[contents zoomWithLatLngBoundsNorthEast:ne SouthWest:se];
}
- (CLLocationCoordinate2DBounds) getScreenCoordinateBounds
{
return [contents getScreenCoordinateBounds];
}
- (RMMarkerManager *)markerManager
{
return [contents markerManager];
}
@end
... ...
... ... @@ -505,6 +505,8 @@
B86F26A80E8742ED007A3773 /* Layers */ = {
isa = PBXGroup;
children = (
090C948B0EC23FCD003AEE25 /* RMMarkerManager.h */,
090C948C0EC23FCD003AEE25 /* RMMarkerManager.m */,
B86F26AC0E87442C007A3773 /* RMMapLayer.h */,
B8F3FC600EA2B382004D8F85 /* RMMapLayer.m */,
B8FA92170E9315EC003A9FE6 /* RMLayerSet.h */,
... ... @@ -522,8 +524,6 @@
B8C9740D0E8A196E007D16AD /* Map */ = {
isa = PBXGroup;
children = (
090C948B0EC23FCD003AEE25 /* RMMarkerManager.h */,
090C948C0EC23FCD003AEE25 /* RMMarkerManager.m */,
B8C9740E0E8A198F007D16AD /* README.txt */,
B8C974690E8A1A50007D16AD /* RMMapView.h */,
B8C9746A0E8A1A50007D16AD /* RMMapView.m */,
... ...