aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-10-09 11:56:52 +0000
committerBibiko <bibiko@eva.mpg.de>2010-10-09 11:56:52 +0000
commitbfd2c744eb99057bba37f331672d828ba48f82f0 (patch)
tree7f88398d8c0c367ac0bfcd64593a2736429a1831 /Source
parent6b60ddf1029b912586f80b6b7727f8083fb122ea (diff)
downloadsequelpro-bfd2c744eb99057bba37f331672d828ba48f82f0.tar.gz
sequelpro-bfd2c744eb99057bba37f331672d828ba48f82f0.tar.bz2
sequelpro-bfd2c744eb99057bba37f331672d828ba48f82f0.zip
• implemented geometrycollection thumbnail images as tooltips for spatial fields
Diffstat (limited to 'Source')
-rw-r--r--Source/SPGeometryDataView.m53
1 files changed, 53 insertions, 0 deletions
diff --git a/Source/SPGeometryDataView.m b/Source/SPGeometryDataView.m
index ee27f15f..95e6d2b7 100644
--- a/Source/SPGeometryDataView.m
+++ b/Source/SPGeometryDataView.m
@@ -125,6 +125,7 @@
for(NSArray* lines in coordinates) {
isFirst = YES;
+ path = [NSBezierPath bezierPath];
for(NSString* coord in lines) {
aPoint = [self normalizePoint:NSPointFromString(coord)];
if(isFirst) {
@@ -143,6 +144,7 @@
NSUInteger i = 0;
for(NSArray* polygons in coordinates) {
isFirst = YES;
+ path = [NSBezierPath bezierPath];
for(NSString* coord in polygons) {
aPoint = [self normalizePoint:NSPointFromString(coord)];
if(isFirst) {
@@ -167,7 +169,58 @@
i++;
if(i>2) i=0;
}
+ }
+ else if([type isEqualToString:@"GEOMETRYCOLLECTION"]) {
+
+ for(NSString* coord in [coordinates objectAtIndex:0]) {
+ [self drawPoint:[self normalizePoint:NSPointFromString(coord)]];
+ }
+ for(NSArray* lines in [coordinates objectAtIndex:1]) {
+ isFirst = YES;
+ path = [NSBezierPath bezierPath];
+ for(NSString* coord in lines) {
+ aPoint = [self normalizePoint:NSPointFromString(coord)];
+ if(isFirst) {
+ [path moveToPoint:aPoint];
+ isFirst = NO;
+ } else {
+ [path lineToPoint:aPoint];
+ }
+ [self drawPoint:aPoint];
+ }
+ [[NSColor blackColor] setStroke];
+ [path stroke];
+ }
+
+ NSUInteger i = 0;
+ for(NSArray* polygons in [coordinates objectAtIndex:2]) {
+ isFirst = YES;
+ path = [NSBezierPath bezierPath];
+ for(NSString* coord in polygons) {
+ aPoint = [self normalizePoint:NSPointFromString(coord)];
+ if(isFirst) {
+ [path moveToPoint:aPoint];
+ isFirst = NO;
+ } else {
+ [path lineToPoint:aPoint];
+ }
+ [self drawPoint:aPoint];
+ }
+ [[NSColor blackColor] setStroke];
+ switch(i) {
+ case 0: [polyFillColor1 setFill];
+ break;
+ case 1: [polyFillColor2 setFill];
+ break;
+ case 2: [polyFillColor3 setFill];
+ break;
+ }
+ [path fill];
+ [path stroke];
+ i++;
+ if(i>2) i=0;
+ }
}
}