How to show a specific region in mapview.

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

How to show a specific region in mapview.

Postby ranjandeo » Thu Aug 05, 2010 12:20 pm

Hello friends,

I have a situation where I need to display an area of 10 KM only in mapview relative to given longitude and latitude.
I got stuck here and not getting nay solution.
In Iphone there is direct method to show some specific region.
Is there something like in Android also?

If any one has the solution then please reply this post.

Thank you.
Ranjan Deo
User avatar
ranjandeo
Experienced Developer
Experienced Developer
 
Posts: 84
Joined: Mon May 31, 2010 6:20 am
Location: Kolkata, India

Top

Re: How to show a specific region in mapview.

Postby blundell » Thu Aug 05, 2010 1:38 pm

This is easily found on developer.android
Google Maps
Code: Select all
                GeoPoint point = new GeoPoint(latitude, longitude);
                mapController.animateTo(point);
                mapController.setZoom(14); // Whatever zoom level you want ( calculate it for 10km if you wish)
User avatar
blundell
Master Developer
Master Developer
 
Posts: 1610
Joined: Tue Nov 18, 2008 12:58 pm
Location: UK

Re: How to show a specific region in mapview.

Postby ranjandeo » Thu Aug 05, 2010 2:04 pm

blundell wrote:This is easily found on developer.android
Google Maps
Code: Select all
                GeoPoint point = new GeoPoint(latitude, longitude);
                mapController.animateTo(point);
                mapController.setZoom(14); // Whatever zoom level you want ( calculate it for 10km if you wish)


Thanks blundell,

Can you please tell me how I can calculate the 10 KM distance ?

Thanks for your time and reply.
Ranjan Deo
User avatar
ranjandeo
Experienced Developer
Experienced Developer
 
Posts: 84
Joined: Mon May 31, 2010 6:20 am
Location: Kolkata, India

Re: How to show a specific region in mapview.

Postby blundell » Thu Aug 05, 2010 2:26 pm

Have a look at these, and see if you can pick an appropriate zoom level

Image

http://www.microimages.com/documentatio ... etZoom.pdf
User avatar
blundell
Master Developer
Master Developer
 
Posts: 1610
Joined: Tue Nov 18, 2008 12:58 pm
Location: UK

Re: How to show a specific region in mapview.

Postby ranjandeo » Thu Aug 05, 2010 2:57 pm

blundell wrote:Have a look at these, and see if you can pick an appropriate zoom level

Image

http://www.microimages.com/documentatio ... etZoom.pdf


Thanks a lot :-)
Ranjan Deo
User avatar
ranjandeo
Experienced Developer
Experienced Developer
 
Posts: 84
Joined: Mon May 31, 2010 6:20 am
Location: Kolkata, India

Re: How to show a specific region in mapview.

Postby pranav09 » Tue Aug 10, 2010 6:07 am

Wow! It's great. I had done almost same thing. It's help me a lot.

Thanks.
Pranav
User avatar
pranav09
Senior Developer
Senior Developer
 
Posts: 128
Joined: Mon Jan 19, 2009 12:01 pm
Location: Ahmedabad, India

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 6 guests