RMMapContents.h
2.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//
// RMMapContents.h
// MapView
//
// Created by Joseph Gentle on 24/09/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "RMLatLong.h"
#import "RMMercator.h"
#import "RMTile.h"
@class RMLatLongToMercatorProjection;
@class RMMercatorToScreenProjection;
@class RMTileImageSet;
@class RMTileLoader;
@class RMMapRenderer;
@class RMMapLayer;
@protocol RMMercatorToTileProjection;
@protocol RMTileSource;
@interface RMMapContents : NSObject
{
// TODO: Also support NSView.
// This is the underlying UIView's layer.
CALayer *layer;
RMMapLayer *background;
RMMapLayer *overlay;
// Latlong is calculated dynamically from mercatorBounds.
RMLatLongToMercatorProjection *latLongToMercatorProjection;
id<RMMercatorToTileProjection> mercatorToTileProjection;
// RMTileRect tileBounds;
RMMercatorToScreenProjection *mercatorToScreenProjection;
id<RMTileSource> tileSource;
RMTileImageSet *imagesOnScreen;
RMTileLoader *tileLoader;
RMMapRenderer *renderer;
}
@property (readwrite) CLLocationCoordinate2D mapCenter;
@property (readwrite) RMMercatorRect mercatorBounds;
@property (readonly) RMTileRect tileBounds;
@property (readonly) CGRect screenBounds;
@property (readwrite) float scale;
@property (readwrite) float zoom;
@property (readonly) RMTileImageSet *imagesOnScreen;
@property (readonly) RMLatLongToMercatorProjection *latLongToMercatorProjection;
@property (readonly) id<RMMercatorToTileProjection> mercatorToTileProjection;
@property (readonly) RMMercatorToScreenProjection *mercatorToScreenProjection;
@property (retain, readwrite) id<RMTileSource> tileSource;
@property (retain, readwrite) RMMapRenderer *renderer;
@property (readonly) CALayer *layer;
@property (retain, readwrite) RMMapLayer *background;
@property (retain, readwrite) RMMapLayer *overlay;
- (id) initForView: (UIView*) view;
// Designated initialiser
- (id) initForView: (UIView*) view WithTileSource: (id<RMTileSource>)tileSource WithRenderer: (RMMapRenderer*) renderer LookingAt:(CLLocationCoordinate2D)latlong;
- (void)moveToLatLong: (CLLocationCoordinate2D)latlong;
- (void)moveToMercator: (RMMercatorPoint)mercator;
- (void)moveBy: (CGSize) delta;
- (void)zoomByFactor: (float) zoomFactor Near:(CGPoint) center;
- (void) drawRect: (CGRect) rect;
//-(void)addLayer: (id<RMMapLayer>) layer above: (id<RMMapLayer>) other;
//-(void)addLayer: (id<RMMapLayer>) layer below: (id<RMMapLayer>) other;
//-(void)removeLayer: (id<RMMapLayer>) layer;
// During touch and move operations on the iphone its good practice to
// hold off on any particularly expensive operations so the user's
+ (BOOL) performExpensiveOperations;
+ (void) setPerformExpensiveOperations: (BOOL)p;
@end