Showing
3 changed files
with
19 additions
and
7 deletions
@@ -60,6 +60,8 @@ | @@ -60,6 +60,8 @@ | ||
60 | - (void)zoomByFactor: (float) zoomFactor near:(CGPoint) center; | 60 | - (void)zoomByFactor: (float) zoomFactor near:(CGPoint) center; |
61 | - (void)removeSublayer:(CALayer *)layer; | 61 | - (void)removeSublayer:(CALayer *)layer; |
62 | - (void)removeSublayers:(NSArray *)layers; | 62 | - (void)removeSublayers:(NSArray *)layers; |
63 | +/// (guess) recompute the screen coordinates for the sublayers (map markers, paths) | ||
64 | +/// \deprecated name will change after 0.5 | ||
63 | - (void) correctPositionOfAllSublayers; | 65 | - (void) correctPositionOfAllSublayers; |
64 | - (BOOL) hasSubLayer:(CALayer *)layer; | 66 | - (BOOL) hasSubLayer:(CALayer *)layer; |
65 | 67 |
@@ -82,23 +82,26 @@ enum { | @@ -82,23 +82,26 @@ enum { | ||
82 | */ | 82 | */ |
83 | @interface RMMapContents : NSObject | 83 | @interface RMMapContents : NSObject |
84 | { | 84 | { |
85 | - // TODO: Also support NSView. | ||
86 | - | ||
87 | /// This is the underlying UIView's layer. | 85 | /// This is the underlying UIView's layer. |
88 | CALayer *layer; | 86 | CALayer *layer; |
89 | 87 | ||
90 | RMMarkerManager *markerManager; | 88 | RMMarkerManager *markerManager; |
89 | + /// subview for the image displayed while tiles are loading. Set its contents by providing your own "loading.png". | ||
91 | RMMapLayer *background; | 90 | RMMapLayer *background; |
91 | + /// subview for markers and paths | ||
92 | RMLayerSet *overlay; | 92 | RMLayerSet *overlay; |
93 | 93 | ||
94 | + /// (guess) the projection object to convert from latitude/longitude to meters. | ||
94 | /// Latlong is calculated dynamically from mercatorBounds. | 95 | /// Latlong is calculated dynamically from mercatorBounds. |
95 | RMProjection *projection; | 96 | RMProjection *projection; |
96 | 97 | ||
97 | id<RMMercatorToTileProjection> mercatorToTileProjection; | 98 | id<RMMercatorToTileProjection> mercatorToTileProjection; |
98 | // RMTileRect tileBounds; | 99 | // RMTileRect tileBounds; |
99 | 100 | ||
101 | + /// (guess) converts from projected meters to screen pixel coordinates | ||
100 | RMMercatorToScreenProjection *mercatorToScreenProjection; | 102 | RMMercatorToScreenProjection *mercatorToScreenProjection; |
101 | 103 | ||
104 | + /// controls what images are used. Can be changed while the view is visible, but see http://code.google.com/p/route-me/issues/detail?id=12 | ||
102 | id<RMTileSource> tileSource; | 105 | id<RMTileSource> tileSource; |
103 | 106 | ||
104 | RMTileImageSet *imagesOnScreen; | 107 | RMTileImageSet *imagesOnScreen; |
@@ -107,9 +110,10 @@ enum { | @@ -107,9 +110,10 @@ enum { | ||
107 | RMMapRenderer *renderer; | 110 | RMMapRenderer *renderer; |
108 | NSUInteger boundingMask; | 111 | NSUInteger boundingMask; |
109 | 112 | ||
110 | - /// \bug These should probably not be here. Instead equivalent functions | ||
111 | - /// should just fetch them when needed from the tileosurce. | ||
112 | - float minZoom, maxZoom; | 113 | + /// minimum zoom number allowed for the view. #minZoom and #maxZoom must be within the limits of #tileSource but can be stricter. |
114 | + float minZoom; | ||
115 | + /// maximum zoom number allowed for the view. #minZoom and #maxZoom must be within the limits of #tileSource but can be stricter. | ||
116 | + float maxZoom; | ||
113 | 117 | ||
114 | id<RMTilesUpdateDelegate> tilesUpdateDelegate; | 118 | id<RMTilesUpdateDelegate> tilesUpdateDelegate; |
115 | } | 119 | } |
@@ -34,12 +34,15 @@ | @@ -34,12 +34,15 @@ | ||
34 | extern NSString * const RMMarkerBlueKey; | 34 | extern NSString * const RMMarkerBlueKey; |
35 | extern NSString * const RMMarkerRedKey; | 35 | extern NSString * const RMMarkerRedKey; |
36 | 36 | ||
37 | +/// one marker drawn on the map. Note that RMMarker ultimately descends from CALayer, and has an image contents. | ||
37 | @interface RMMarker : RMMapLayer <RMMovingMapLayer> { | 38 | @interface RMMarker : RMMapLayer <RMMovingMapLayer> { |
39 | + /// (guess) the anchorPoint of the image is plotted here | ||
38 | RMXYPoint location; | 40 | RMXYPoint location; |
39 | 41 | ||
40 | - NSObject* data; // provided for storage of arbitrary user data | 42 | + /// provided for storage of arbitrary user data |
43 | + NSObject* data; | ||
41 | 44 | ||
42 | - // A label which comes up when you tap the marker | 45 | + /// A label which comes up when you tap the marker |
43 | UIView *labelView; | 46 | UIView *labelView; |
44 | UIColor *textForegroundColor; | 47 | UIColor *textForegroundColor; |
45 | UIColor *textBackgroundColor; | 48 | UIColor *textBackgroundColor; |
@@ -69,8 +72,11 @@ extern NSString * const RMMarkerRedKey; | @@ -69,8 +72,11 @@ extern NSString * const RMMarkerRedKey; | ||
69 | 72 | ||
70 | - (void) setLabel: (UIView*)aView; | 73 | - (void) setLabel: (UIView*)aView; |
71 | - (void) setTextLabel: (NSString*)text; | 74 | - (void) setTextLabel: (NSString*)text; |
75 | +/// \deprecated name change or deletion pending after 0.0 | ||
72 | - (void) setTextLabel: (NSString*)text toPosition:(CGPoint)position; | 76 | - (void) setTextLabel: (NSString*)text toPosition:(CGPoint)position; |
77 | +/// \deprecated name change or deletion pending after 0.0 | ||
73 | - (void) setTextLabel: (NSString*)text withFont:(UIFont*)font withTextColor:(UIColor*)textColor withBackgroundColor:(UIColor*)backgroundColor; | 78 | - (void) setTextLabel: (NSString*)text withFont:(UIFont*)font withTextColor:(UIColor*)textColor withBackgroundColor:(UIColor*)backgroundColor; |
79 | +/// \deprecated name change or deletion pending after 0.0 | ||
74 | - (void) setTextLabel: (NSString*)text toPosition:(CGPoint)position withFont:(UIFont*)font withTextColor:(UIColor*)textColor withBackgroundColor:(UIColor*)backgroundColor; | 80 | - (void) setTextLabel: (NSString*)text toPosition:(CGPoint)position withFont:(UIFont*)font withTextColor:(UIColor*)textColor withBackgroundColor:(UIColor*)backgroundColor; |
75 | - (void) toggleLabel; | 81 | - (void) toggleLabel; |
76 | - (void) showLabel; | 82 | - (void) showLabel; |
-
Please register or login to post a comment