forked from jellehelsen/mapkit
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMKMarker.j
58 lines (49 loc) · 1013 Bytes
/
MKMarker.j
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
@import <Foundation/CPObject.j>
@implementation MKMarker : CPObject
{
google.maps.Marker gmarker @accessors;
google.maps.InfoWindow infoWindow;
MKMapView mapView;
}
- (id)init
{
if (self = [super init])
{
gmarker = new google.maps.Marker();
}
return self;
}
- (CLLocationCoordinate2D)position
{
CLLocationCoordinate2DFromLatLng(gmarker.getPosition());
}
- (void)setPosition:(CLLocationCoordinate2D)aCoordinate
{
gmarker.setPosition(LatLngFromCLLocationCoordinate2D(aCoordinate));
}
- (void)addToMapView:(MKMapView)aMapView
{
[aMapView addMarker:self];
}
- (CPString)title
{
gmarker.getTitle();
}
- (void)setTitle:(CPString)aTitle
{
gmarker.setTitle(aTitle);
}
-(CPString)infoWindowContent
{
if(infoWindow) return infoWindow.getContent();
return @"";
}
-(void)setInfoWindowContent:(CPString)aString
{
if(!infoWindow) {
infoWindow = new google.maps.InfoWindow();
infoWindow.open(gmarker.getMap(), gmarker);
}
infoWindow.setContent(aString);
}
@end