Hi VindaMedia,
Not sure if you're the one I was chatting with a few days ago about this but
I believe I brought up the question of what those values really meant. I
thought about it again today and figured I should be able to find some
example that uses the same conventions your showing and I found this:
http://itouchmap.com/latlong.html
In viewing the source you can see the method that's used to do the
conversion (it assumes that the format uses +/- instead of N/S or E/W but
otherwise it appears to be doing the same).... doing a bit more searching
I'm finding other examples and feeling a bit dumb that I didn't realize what
the format was as I have seen this in the past I just have had lat/lngs
presented to me in the format google maps accepts from the beginning, more
on the resources I'll use to put it together here:
http://en.wikipedia.org/wiki/North_American_Datum
http://www.fcc.gov/mb/audio/bickel/DDDMMSS-decimal.html
http://zonalandeducation.com/mmts/trigonometryRealms/degMinSec/degMinSec.htm
If you find out it is one of the particular specifications described in that
wiki link that will help to make sure I'm expecting the appropriate types of
values, my plan is write a function that takes a string (including the N or
whatever, does the conversion to +/- does the minutes conversion to
degrees... assuming seconds is lumped into the minutes decimal value and
spits out a Number).
Based on my assumptions my function would be:
public function degMinSecToLatLngDec(degMinSec:String="N12
12.231"):Number
{
var parts:Array = degMinSec.split(" ");
parts[0] = (parts[0] as String).substr(1);
if(degMinSec.charAt(0)=="W" || degMinSec.charAt(0) == "S")
return -parseFloat(parts[0])-parseFloat(parts[1])/60;
else
return parseFloat(parts[0])+parseFloat(parts[1])/60;
}
Shaun
--
You received this message because you are subscribed to the Google Groups
"Google Maps API For Flash" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-api-for-flash?hl=en.