Hi, The documentation says that placemark[0].point is a LatLng object. If that's the case, you can get the lat and lng by calling
placemarks[0].point.lat() and placemarks[0].point.lng() respectively. Hope that helps, Sam (The docs for a LatLng are at http://code.google.com/apis/maps/documentation/flash/reference.html#LatLng ) On Oct 8, 3:05 pm, stefancaunter <[EMAIL PROTECTED]> wrote: > Hi, sorry for the basicness and probable obviousness of this question. > > I need to pass a geocoding result into a mysql query to get proximity > figures for a locator. Database has addresses all geocoded. > > If I examine the placemarks array, element 0, it shows (49,-123) -- > something reasonable. > > The actual lat and lng won't come out for me as the two numbers I need > no matter what I try. > Splitting on the comma leaves parentheses as a trailing or preceding > artifact, and I cannot > successfully pull it out by asking for it as Text or as String. > > So how do I just get lat and lng as usable text to inject into a query > like this? > //var getClosest:String = "SELECT lat,lng, ( 6371 * > acos( cos( radians('" + latLngArray[0] + "') ) * cos( radians( lat ) ) > * cos( radians( lng ) - radians('" + latLngArray[1] + "') ) + > sin( radians('" + latLngArray[0] + "') ) * sin( radians( lat ) ) ) ) > AS distance FROM mydb.table HAVING distance < 100 ORDER BY distance;" > > Here is a chronicle of some of my futility (the attempts are all > commented...) > > function(event:GeocodingEvent):void { > var placemarks:Array = event.response.placemarks; > if (placemarks.length > 0) { > map.setCenter(placemarks[0].point); > var marker:Marker = new Marker(placemarks[0].point); > //this works > Alert.show(placemarks[0].point); > //this leaves '(' and ')' > var myLocation:Array = placemarks[0].point; > //var latLngArray:Array = myLocation.split(","); > //this doesn't get it out either > //var myAlert:Number = myLocation.lat(); > //var myAlert:Text = myLocation[0] as String; > //Alert.show(myAlert); > > Stefan --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
