longitude/latitude degrees according to cursor

  • carolin
  • Born
  • Born
  • carolin
  • Posts: 1

Post 3+ Months Ago

hi all.
working at work and trying feverishly to figure out how to do the following:

We want to make longitude and latitude lines follow the cursor, and at the same time have the degrees change accordingly. Any ideas?
The lines could be put in there easily, as a movie clip, but the numbers? argh

thanks for any comments
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • roarmeow
  • Professor
  • Professor
  • User avatar
  • Posts: 861
  • Loc: BKNY

Post 3+ Months Ago

to set up the latitude and longitude, all you have to do is...

a) figure out what the latitude and longitude are in the top-left corner of the stage (i.e. where _ymouse and _xmouse = 0)

b) figure out what the conversion is between latitude and longitude and pixels...

then you can work something out like:
Code: [ Select ]
var latitude=Number(23+(10*(_root._ymouse)));
var longitude=Number(17+(10*(_root._xmouse)));
  1. var latitude=Number(23+(10*(_root._ymouse)));
  2. var longitude=Number(17+(10*(_root._xmouse)));


or something... where each pixel corresponds to 10 degrees of latitude or longitude and the top-left corner of the stage is lat=23, long=17.

i hope this helps...
  • koivi
  • Novice
  • Novice
  • koivi
  • Posts: 23
  • Loc: Minnesota

Post 3+ Months Ago

Of course, roarmeow's answer assumes that the map does not have any distortion to it in the area that you are using (I forget what the name of those maps are, but they sometimes look pretty odd because of the whole Earth radius thing...)

I was playing with something along the lines of plotting GPS coords as points on a map once:

http://waf.rangenet.com/Sites/mt-exp/test.swf

Eventually, our client will want to continue with this idea, but it's been sitting for about a year or so right now... You can see how some of the red dots aren't covered by the blue/white ones. The red ones were plotted with GIS software (which is what generated the map as well), and the others are the ones plotted with the GPS coords. The trail in the map is approx 130 miles long.

The flash movie reads in the points from a php script (which pushes from a database), then the Actionscript takes that information, scales it down to decide which pixel coords to use, then rotates it along an axis to find the final resting spot. If interested, I should be able to send the fla file out.
  • roarmeow
  • Professor
  • Professor
  • User avatar
  • Posts: 861
  • Loc: BKNY

Post 3+ Months Ago

good point, koivi... i totally forgot that the world is a sphere and not flat!
:oops:

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 11 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.