Select to view content in your preferred language

Graphics Polygon Doughnut color reversal

959
3
12-21-2011 10:35 AM
NickLorenzen
Emerging Contributor
I am drawing a Polygon on a map of the State of Michigan to focus on the I-94 corridor.  To do so, I've drawn a full polygon covering our entire state, then manually created and empty doughnut around the highway.  So, there are at least a couple of hundred points (more like 500+). 

In general this is functional as a prototype to display to the customer, but the issue that I am having is when I zoom in, to a certain zoom level (level LOD: 8, resolution:9.55462890525781, scale:36111.91104) the color on polygon reverses.  Meaning that the doughnut that was supposed to have no color filled turns color and the rest of the map has no color.

I was able to replicated this using the maps toolbar example at
http://help.arcgis.com/en/webapi/javascript/arcgis/demos/mobile/mobile_drawtoolbar.html
by manually drawing a polygon with a doughtnut and zooming in (level: 14, resolution:9.55462853563415, scale:36111.909643).


EDIT: Oddly enough, with more testing, when I zoomed in 2-3 more levels the polygon shading fixed itself for that level and closer (but when I zoomed back out it was broken again)

Any suggestions on what could be causing this and solutions?

Thanks,
Nick Lorenzen
0 Kudos
3 Replies
StephenLead
Honored Contributor
Any suggestions on what could be causing this and solutions?


Nick,

I don't have a resolution, but the reversal of the colours can indicate a corrupt shape, possibly caused by the donut not being created correctly when digitizing manually in the JS API.

You may need to run some sort of validation geoprocessing service over the digitized shape to verify that it's legitimate.

EDIT: perhaps check out the geometry service helpfile entry

Good luck,
Steve
0 Kudos
NickLorenzen
Emerging Contributor
Nick,

You may need to run some sort of validation geoprocessing service over the digitized shape to verify that it's legitimate.

EDIT: perhaps check out the geometry service helpfile entry

Good luck,
Steve


Thanks for the help, I checked out the Geometry Service entry and checked to see if the Polygon was intersecting with the esri.geometry.polygonSelfIntersecting() method.  This method is returning false, so it isn't self intersecting, and I also know that is it enclosed because my first point and my last point is exactly the same.

However, when I looked at the DOM, it turns out that I have over 10,000 points to create this polygon.  So, the only thing I can think of is that I've overwhelmed the Library and it just can't handle that many points at once.



EDIT:
It turns out that the polygon has trouble handling it if you do all the points in a single rings.  I modified the way that I create the doughnut to have the outer part as the first ring, and then in inner doughnut as a separate ring.  As soon as I did that it worked fine.
0 Kudos
jaykapalczynski
Honored Contributor
Nick I am trying to do something similar....create a donut graphic so I can use that as a buffer geometry...
How did you create that donut graphic?  You have any examples out there?
0 Kudos