![]() |
calculate x & y from lat & long
I am getting GPS data on my window
Actual GPS DATA is stored in these 2 variables Code:
float landlong= 77.384547E //Realtime LongtitudeCode:
xPos = 1415.7537 Code:
m_WndWidth=1099Code:
xPos = (landlong - m_fMinLon) * (m_WndWidth / (m_fMaxLon - m_fMinLon)) ;Code:
BOTTOM RIGHT CORDINATESThanks in advance |
Re: calculate x & y from lat & long
your formula seems to be alright. but your point is getting displayed beyond the screen display area. to solve this, you need to map (or scale in other words) the start and end co ordinates of your map with your display area, and also you should scale every gps point you are displaying wrt the screen co ordinates.
long back, i also faced the same problem, and i solved it this way. feel free to mail me, for any further queries. chandu004@yahoo.com |
| All times are GMT +5.5. The time now is 05:52. |