The differentiator between polygons and polylines is the fill color. If the fillPaint is equal to OMColor.clear, then the poly will be considered a polyline. There are methods to override this in the OMPoly class, but they do play around with the fillPaint, depending on the order in which the methods are called. If you know it's a polyline, call setIsPolygon(false) if you think that the fillPaint could be set to anything other than the default, OMColor.clear.
All of the OMGraphics are moving to having their internal representation as java.awt.Shape objects. Unfortunately, this has the side effect of slowing OMPolys down, because the way that the projection classes handle transformations cause more objects to be allocated and more loops to be run through. So, by default, the OMPoly does NOT use Shape objects internally, to keep layers that throw down many, many polys running quickly. If you want to do some spatial analysis on an OMPoly, call setDoShapes(true) on it, then generate(Projection), and then call getShapes() to get the java.awt.Shape objects for the poly. You can then run the different Shape spatial analysis methods on the Shape objects.
|
|
|
|