Mailing List
Home
Forum Home
Flash Pro
Subjects
Firework Effect
setInterval bug identified and fixed
setInterval bug identified and fixed
ScrollPane component doesn 't auto update
Help: MX 2004 How to script a print button to print the entire sli
Event Dispatcher between classes
memory management removeMovieClip /
MX2004 Dataset itemClassName
Order of events per frame
XML to Object help
Textfield prototype question
Flash and QuickTime VR
Reading and displaying RSS feeds in Flash MX
Flash MX 2004 Sucks
AW: [Flashcoders] Switch/Case vs If/else
AW: [Flashcoders] Switch/Case vs If/else
Flash Interface with 10mb xml file
Web Service Results
Listener Object 's best practice
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
Long x Lat to X and Y

Long x Lat to X and Y

2004-03-11       - By Jayson K Hanes

 Back
Reply:     1     2     3     4     5     6     7     8     9     10  

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.