How to pan d map(left, right, up down)

Put your problem here if it does not fit any of the other categories.

How to pan d map(left, right, up down)

Postby Jitendra Kumar » Thu Mar 06, 2008 11:57 am

Does anyone know how to pan d map? Is there any functionality in MapController to accomplish dis task.
Jitendra Kumar
Developer
Developer
 
Posts: 49
Joined: Thu Mar 06, 2008 7:55 am
Location: Bangalore

Top

Postby plusminus » Fri Mar 07, 2008 12:32 am

Hello

what about MapController.centerMapTo(Point p);
Sample:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. this.myMapController.centerMapTo(new Point(
  2.                                 (int)(this.myLocation.getLatitude() * 1E6),
  3.                                 (int)(this.myLocation.getLongitude() * 1E6)),true);
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby Jitendra Kumar » Fri Mar 07, 2008 6:40 am

Hi! This is Jitendra, while i execute the code above, the map moves to a position from the Point( 37.418402, -122.025078) a place of US to Svalbard(another island). Do u know how to edit 1E6 such dat we can move to a place closer to user location. Otherwise we have to check practicaly how much to move ur point by changing lat/lng n its complicated if user zooms in and out and tries to pan.
Jitendra Kumar
Developer
Developer
 
Posts: 49
Joined: Thu Mar 06, 2008 7:55 am
Location: Bangalore

Postby plusminus » Sun Mar 09, 2008 12:36 pm

Hello Jitendra,

if [font=Lucida Console]myLocation[/font] contains the GPS-position, the [font=Lucida Console]centerTo[/font] focuses that Position 100% exactly :!:

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: MSNbot Media and 13 guests