forked from jfahrenkrug/MapKit
-
Notifications
You must be signed in to change notification settings - Fork 2
/
MKMapViewAttributeInspector.j
65 lines (51 loc) · 1.93 KB
/
MKMapViewAttributeInspector.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
59
60
61
62
63
64
65
@import <AtlasKit/AtlasKit.j>
@implementation MKMapViewAttributeInspector : AKInspector
{
@outlet CPTextField latitudeField;
@outlet CPTextField longitudeField;
@outlet CPPopUpButton mapTypePopUpButton;
}
- (void)awakeFromCib
{
[mapTypePopUpButton removeAllItems];
[mapTypePopUpButton addItemWithTitle:@"Map"];
[[mapTypePopUpButton lastItem] setTag:MKMapTypeStandard];
[mapTypePopUpButton addItemWithTitle:@"Satellite"];
[[mapTypePopUpButton lastItem] setTag:MKMapTypeSatellite];
[mapTypePopUpButton addItemWithTitle:@"Hybrid"];
[[mapTypePopUpButton lastItem] setTag:MKMapTypeHybrid];
[mapTypePopUpButton addItemWithTitle:@"Terrain"];
[[mapTypePopUpButton lastItem] setTag:MKMapTypeTerrain];
}
- (CPString)label
{
return @"Map View";
}
- (CPString)viewCibName
{
return @"MKMapViewAttributeInspector";
}
- (void)refresh
{
var inspectedObjects = [self inspectedObjects];
[latitudeField takeValueFromKeyPath:@"centerCoordinateLatitude" ofObjects:inspectedObjects];
[longitudeField takeValueFromKeyPath:@"centerCoordinateLongitude" ofObjects:inspectedObjects];
[mapTypePopUpButton takeValueFromKeyPath:@"mapType" ofObjects:inspectedObjects];
}
- (@action)takeStringAddressFrom:(CPSearchField)aSearchField
{
[[self inspectedObjects] makeObjectsPerformSelector:@selector(takeStringAddressFrom:) withObject:aSearchField];
}
- (@action)takeLatitudeFrom:(CPTextField)aTextField
{
[[self inspectedObjects] makeObjectsPerformSelector:@selector(setCenterCoordinateLatitude:) withObject:[aTextField floatValue]];
}
- (@action)takeLongitudeFrom:(CPTextField)aTextField
{
[[self inspectedObjects] makeObjectsPerformSelector:@selector(setCenterCoordinateLongitude:) withObject:[aTextField floatValue]];
}
- (@action)takeMapTypeFrom:(id)aPopUpButton
{
[[self inspectedObjects] makeObjectsPerformSelector:@selector(setMapType:) withObject:[[aPopUpButton selectedItem] tag]];
}
@end