  | |  | Long x Lat to X and Y | Long x Lat to X and Y 2004-03-11 - By Jayson K Hanes
Back I did this all a couple years ago for my visitor/location world map placement for my chat (and avatar placement too).. and I of course still use it.. for the FlashLounge "people locations thingy", I hope to re-invent its purpose...
Anyways.. I had to invent and tinker with some graphics for it (which map is it?? I didn't/don't care.. looks great (IMO) and works predictably) and play with some lame, yet, effective equations for the results:
Based on a jpg 1024x400px (world map) http://chatbugs.com/rawmap1.jpg (I DO have this as a nice vector and at 5x rez but its HUGE)
//"cLat", "cLon" (strings from database) //0 Lat, 0 Long on the map => 469.4, 227.8, mapScale = 1 (1:1) //82.4717,27.9733 => 231.43, 148.6 [Tampa, Florida]
Dot._x=Math.ceil((469.4-(parseInt(cLat)*469.4/-160))*mapScale); Dot._y=Math.ceil((227.8-(parseInt(cLon)*227.8/80))*mapScale);
..as to "How" you can adjust it for your needs kinda depends.....
That's what I came up with for MY needs and it works, and I left it.. it could be optimized perhaps better.. as I make time this weekend to play more with it I'll post the results!
Hope that helps!
-Jayson K. Hanes http://chatbugs.com
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- Supported by Fig Leaf Software =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- Be sure to check the archives and the wiki: http://chattyfig.figleaf.com/ =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:106714 =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- To unsubscribe send a blank e-mail to: Normal Mode: flashcoders-unsubscribe@(protected) Digest Mode: flashcoders-digest-unsubscrive@(protected)
Earn $52 per hosting referral at Lunarpages.
|
|
 |