Closed ludawei closed 8 years ago
Yeah, so the problem here is that you're overlaying a giant polygonal feature on a sphere. We need to break the polygonal feature up to make it look reasonable. In an ideal world I'd use a triangulation engine that understood spheres... but no, we have to hack it.
The way you hack it is to ask the vectors to subdivide on the sphere. Try setting the following in the description dictionary for the addVectors call: kMaplySubdivType: kMaplySubdivSimple, kMaplySubdivEpsilon: @(0.001)
Yes, I tried setting the following in the description dictionary for the addVectors call: kMaplySubdivType: kMaplySubdivSimple, kMaplySubdivEpsilon: @(0.001)
... but, nothing changes.
I tried some other colors and found that, Set the color of the alpha value is 1.0, extra lines in the filled area disappear.
Is the problem caused by the color of the alpha?
No, it's the tessellation. Does it at least look different with the subdivision on?
If adjusting the alpha reduces the problem, that seems like a fine workaround.
But not a fundamental solution.
Setting the alpha to 1.0, will not show the map information behind the filled area. That's not so good.
Any other ideas?
True. So you'll need to try a few things.
With the subdivision on, set kMaplyFilled: @(NO) Ideally you should see a bunch of rectangles. This is what we're breaking that big areal down into. Try a small subdivision number and see if it results in more rectangles. In any case, post the snapshot so I can see what's going on.
Hi, The following are some of the test cases:
Set kMaplyFilled: @(NO), it works well.
Try setting the kMaplySubdivType to kMaplySubdivGrid.
That epsilon my be too low for grid, by the way. Try setting it back to the number I gave you before and then dividing by 10 until you get something.
What you should see is a lot of little grid cells over the areal feature.
UIColor color = [UIColor colorWithRed:1 green:0 blue:0 alpha:1.0]; NSDictionary vectorDict = @{ kMaplyColor: color, kMaplyDrawPriority: @(kMaplyLoftedPolysDrawPriorityDefault), kMaplySubdivType: kMaplySubdivGrid, kMaplySubdivEpsilon: @(0.000001), kMaplyFilled: @(NO), };
Other settings unchanged , test epsilon from 1 to 0.000001. But nothing appears. :)
Unfortunately setting the grid doesn't show up with the outlines. I did get this to work pretty well with the following settings: desc[kMaplyFilled] = @(YES); desc[kMaplySubdivType] = kMaplySubdivGrid; desc[kMaplySubdivEpsilon] = @(0.01);
That seems to clean things up well for me.
with he following codes:
Some extra lines appear in the filled area:
And, rotate the earth: