-
Notifications
You must be signed in to change notification settings - Fork 1
/
Room.m
57 lines (47 loc) · 1.31 KB
/
Room.m
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
//
// Room.m
//
//
// Created by admin on 12-10-11.
// Copyright (c) 2012 Esri Canada. All rights reserved.
//
#import "Room.h"
@implementation Room
- initWithNumber:(NSString*)n building:(NSString*)b planId:(NSString*)p graphic:(AGSGraphic*)g accessible:(BOOL)a
{
self = [super init];
self.graphic = g;
self.number = n;
self.building = b;
self.planId = p;
self.accessible = a;
self.visible = NO;
self.markerSymbol = [[AGSSimpleMarkerSymbol alloc]init];
self.markerSymbol.color = [UIColor redColor];
self.markerSymbol.size = CGSizeMake(20,20);
self.markerSymbol.style = AGSSimpleMarkerSymbolStyleCircle;
self.markerSymbol.outline.color = [UIColor whiteColor];
self.markerSymbol.outline.width = 3;
AGSTextSymbol* label = [[AGSTextSymbol alloc] initWithText:self.number color:[UIColor blackColor]];
label.hAlignment = AGSTextSymbolHAlignmentCenter;
label.fontSize = 0;
self.graphic.symbol = label;
return self;
}
-(void) hide:(AGSGraphicsLayer *)layer
{
[layer removeGraphic:self.graphic];
}
-(void) show:(AGSGraphicsLayer *)layer
{
BOOL found = NO;
for (AGSGraphic* gr in[layer graphics])
{
if ([gr isEqual:self.graphic])
{
found = YES;
}
}
if (!found)[layer addGraphic:self.graphic];
}
@end