Reputation: 2801
I need to do following task: there is Google Map widget and user can move/zoom the map. When user click the button that application should show latitude & longitude of bounds of GMap (north-east corner and south-west corner). But I don't know how I can do it. I hope you can help me. Thank you for, anyway.
Upvotes: 2
Views: 1634
Reputation: 23873
This should do it
Actually I meant
GeoPoint tlGpt; // Top left (NW) Geopoint
GeoPoint brGpt; // Bottom right (SE) GeoPoint
GeoPoint trGpt; // Top right (NE) Geopoint
GeoPoint blGpt; // Bottom left (SW) GeoPoint
tlGpt = mapView.getProjection().fromPixels(0, 0);
brGpt = mapView.getProjection().fromPixels(mapView.getWidth(),
mapView.getHeight());
trGpt = mapView.getProjection().fromPixels(mapView.getWidth(), 0);
blGpt = mapView.getProjection().fromPixels(0, mapView.getHeight());
First post gave you NW and SE - this gives all 4 corners
Upvotes: 4