How to convert distance (in meters) to pixels in MapView

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

How to convert distance (in meters) to pixels in MapView

Postby Praline » Thu Mar 27, 2008 12:10 pm

Hi,

I search a way to convert a distance in meters to a number of pixels.
If some one have an idea .

Thanks.
--
Praline.
Praline
Junior Developer
Junior Developer
 
Posts: 11
Joined: Tue Feb 12, 2008 3:53 pm

Top

Postby Praline » Thu Mar 27, 2008 2:31 pm

It's probably not so easy and depends on where we are :(.
Praline
Junior Developer
Junior Developer
 
Posts: 11
Joined: Tue Feb 12, 2008 3:53 pm

Postby don » Fri Mar 28, 2008 2:06 pm

If I remember correctly it is:

px/m=2^(7+zoomLevel)/(2*Pi*r*cos(lat))

where r is the mean radius of the earth (6378km I think, though a internet search should confirm this number).

Let me know if that doesn't work and I will check the formula when I get a chance.
don
Junior Developer
Junior Developer
 
Posts: 18
Joined: Fri Dec 07, 2007 5:17 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot], MSNbot Media and 16 guests