mapview overlay problem

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

mapview overlay problem

Postby rupert33 » Fri Apr 23, 2010 2:06 pm

Hi i've got an overlay on the map which is a line from two points on the mapactivity, but the problem is when the user moves the map or zooms in and out the overlay doesn't stay where it is i.e. isn't still at the same points, the overlay follows the screen? can anyone help me with this problem
rupert33
Freshman
Freshman
 
Posts: 3
Joined: Sat Apr 17, 2010 4:55 pm

Top

Postby kec6227 » Fri Apr 23, 2010 3:24 pm

I would get the x, y coords for line points, and then use getProjection().fromPixels() to get the geopoints for each endpoint. Then use toPixels on every refresh to draw the line.
kec6227
Developer
Developer
 
Posts: 30
Joined: Fri Jul 24, 2009 7:31 pm

Postby rupert33 » Fri Apr 23, 2010 3:42 pm

thanks for the reply

is there a onrefresh handler or something then that i need to use?
rupert33
Freshman
Freshman
 
Posts: 3
Joined: Sat Apr 17, 2010 4:55 pm

Postby kec6227 » Fri Apr 23, 2010 3:50 pm

I don't have any documentation in front of me, but the overlay should have an onDraw method or something like that, and it is called everytime the map changes so it is the refresh essentially.

You may want to look at:
http://www.androidcompetencycenter.com/tag/map-overlay/
kec6227
Developer
Developer
 
Posts: 30
Joined: Fri Jul 24, 2009 7:31 pm

Top

Return to Map Problems

Who is online

Users browsing this forum: Exabot [Bot] and 5 guests