You have to set boundaries of your info window or icon overlay.
private int minX = 0;
private int maxX = 0;
private int minY = 0;
private int maxY = 0;
boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when){
...
minX = screenPoint.x;
maxX = screenPoint.x + info window or icon width;
minY = screenPoint.y;
maxY = screenPoint.y + info window or icon height;
...
}
boolean onTap(GeoPoint point, MapView mapView){
...
if (isHitInfoWindow(point, mapView){
// do what you want..
}
...
}
private boolean isHitInfo(GeoPoint point, MapView mapView){
boolean bln = false;
Point screenPoint = new Point();
mapView.getProjection().toPixels(point, screenPoint);
int pointX = screenPoint.x;
int pointY = screenPoint.y;
if ((pointX >= minX) && (pointX <= maxX) &&
(pointY >= minY) && (pointY <= maxY)){
return true;
}
return bln;
}
2009/9/1 Sasi Kumar <[email protected]>:
>
> Can any one help to create map view with a marker.
>
> When we are clicking marker it should display info window.
>
> By clicking that info window it shoul goto another layout.
>
>
> Ple. reply me.
>
>
> thanks in advance.
> >
>
--
Panut Sunyakorn
087-800-3456
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---