i've currently a few polygon shapes as shown below that is being drawn onto my mapview with the following code
CustomPolygon customPolygon= data.getCustomPolygonList().get(i);
Path path = new Path();
path.setFillType(Path.FillType.EVEN_ODD);
for(int n=0;n<customPolygon.getCorrdinateList().size();n++)
{
GeoPoint sector1 = new GeoPoint((int)(customPolygon.getCorrdinateList().get(n).getLatitude()*1e6), (int)((customPolygon.getCorrdinateList().get(n).getLongitude())*1e6));
if(n==0){
mapView.getProjection().toPixels(sector1, point1_draw);
path.moveTo(point1_draw.x,point1_draw.y);
}else
{
mapView.getProjection().toPixels(sector1, point1_draw);
path.lineTo(point1_draw.x,point1_draw.y);
}
}
path.close();
canvas.drawPath(path, paint);
Right now i'm figuring on how do i know if the ontap button is intersecting any of the polygon. for example if it intersect one of the polygon, a message will display the current polygon.
I'm stuck at the ontap part for the overlay.
@Override
public boolean onTap(GeoPoint p, MapView ) {
Point point1_draw = new Point();
mapView.getProjection().toPixels(p, point1_draw);
for (int i =0;i<data.getCustomPolygonList().size();i++)
{
CustomPolygon customPolygon= data.getCustomPolygonList().get(i);
for(int n=0;n<customPolygon.getCorrdinateList().size();n++)
{
}
}
return true;
}