Closed ForTraces closed 6 months ago
Looks like the polygon may be in the wrong order. I'd try reordering it and see if that helps.
NSDictionary *invecDes = @{ kMaplyDrawPriority: @(kMaplyShapeDrawPriorityDefault), kMaplyFilled:@(YES), kMaplyVecWidth: @(6.0) };
NSArray *points = @[@{@"lon":@"171.824569",@"lat":@"26.289429"}, @{@"lon":@"-174.022374",@"lat":@"26.406445"}, @{@"lon":@"177.511999",@"lat":@"16.911654"}, @{@"lon":@"162.878838",@"lat":@"16.045829"}, ];
MaplyCoordinate coords[points.count]; for (int i = 0; i < points.count; i++) { NSDictionary dict = points[i]; coords[i]= MaplyCoordinateMakeWithDegrees([dict[@"lon"] doubleValue],[dict[@"lat"] doubleValue]); } MaplyVectorObject vec = [[MaplyVectorObject alloc] initWithAreal:coords numCoords:(int)points.count attributes:@{kMaplyColor:[UIColor redColor]}];
[self.baseViewC addVectors:@[vec] desc:invecDes mode:MaplyThreadCurrent];
When I set kMaplyFilled to NO it is normal,
I set kMaplyFilled to YES the drawing is wrong
All we're doing is passing the data to the old GL tessellator. So you'll want to try a few things to figure out what it doesn't like your polygon:
All we're doing is passing the data to the old GL tessellator. So you'll want to try a few things to figure out what it doesn't like your polygon:
* Are there duplicate points? * Is this the wrong winding order? Try reversing it. * Look at other examples and see if there's anything different from yours.
All we're doing is passing the data to the old GL tessellator. So you'll want to try a few things to figure out what it doesn't like your polygon:
* Are there duplicate points? * Is this the wrong winding order? Try reversing it. * Look at other examples and see if there's anything different from yours.
Hello:
NSDictionary invecDes = @{ kMaplyDrawPriority: @(kMaplyVectorDrawPriorityDefault), kMaplyFilled:@(YES), kMaplyVecWidth: @(6.0) }; NSArray points = @[@{@"lon":@"170.883246",@"lat":@"29.263676"}, @{@"lon":@"-172.793431",@"lat":@"28.646870"}, @{@"lon":@"-172.449873",@"lat":@"16.130755"}, @{@"lon":@"172.862239",@"lat":@"15.604583"}, ];
MaplyCoordinate coords[points.count]; for (int i = 0; i < points.count; i++) { NSDictionary dict = points[i]; coords[i]= MaplyCoordinateMakeWithDegrees([dict[@"lon"] doubleValue],[dict[@"lat"] doubleValue]); } MaplyVectorObject vec = [[MaplyVectorObject alloc] initWithAreal:coords numCoords:(int)points.count attributes:@{kMaplyColor:[UIColor redColor]}]; [self.baseViewC addVectors:@[vec] desc:invecDes mode:MaplyThreadCurrent];
Version: 2.6.5 The test code is as above, sliding the earth to fill the quad will pass through the earth
Crossing 180 might be a problem, it's true. You could try breaking up the polygon across that boundary.
Quad After adding the division code, the quad will circle the earth. How does this need to be set up?
I would recommend explicitly clipping your data on that boundary to get better control of the display.
hello: I use the addVectors method to draw the area,The properties are as follows @{ kMaplyDrawPriority: @(kMaplyVectorDrawPriorityDefault), kMaplyVecWidth: @(6.0), kMaplyFilled:@YES,
When a lat/long crosses 180, the padding becomes abnormal