Hello,
I want to display borders (based on GeoPoints) on my mapview.
But as far as I know android does not support anything like
"java.awt.polygon"?
My problem is that if I add new points to my polygon some edges
intersect with others edges. The soloution is that I have to sort my
points into the right order, but I think this is not really trivial...
At the moment I draw my polygon with following code into the draw-
method
of an ItemizedOverlay:
public void draw(Canvas canvas, MapView mapView, boolean shadow) {
...
for(int i = 0; i < geopoints.size(); i++){
//If its not the last point: connect the current
point with its next
if ( i < size()-1 )
canvas.drawLine(Point(i).x,
Point(i).y, Point(i+1).x, Point(i+1),mPaint);
//The last point will be connected to the
first(0) the get a closed polygon
else
canvas.drawLine(Point(i).x,
Point(i).y, Point(0).x, Point(0).y, mPaint);
}
...
}
Any suggestions?
Greetz dudero
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en