Hi Will- If you want the distance of the Driving Directions route, just use the distance property: http://code.google.com/apis/maps/documentation/flash/reference.html#Directions.distance
There are various directions demos here: http://code.google.com/apis/maps/documentation/flash/demogallery.html?searchquery=directions&classname= If you want the straight distance between latitude/longitude pairs use distanceFrom with geocoding. There are various geocoding demos here: http://code.google.com/apis/maps/documentation/flash/demogallery.html?searchquery=geocoding&classname= - pamela On Sat, Oct 25, 2008 at 8:01 PM, Will <[EMAIL PROTECTED]> wrote: > > Sorry to bring this up again, but I can't figure this out. > Has anybody got an idea how I can get google maps to return the > geocodes? I'm really stuck :( > > On Oct 23, 9:34 pm, Will <[EMAIL PROTECTED]> wrote: > > I found this code: > > > > // Calculate distance in km between London and Sydney. > > var london:LatLng = new LatLng(51.53, -0.08); > > var sydney:LatLng = new LatLng(-34.0, 151.0); > > trace("km: " + sydney.distanceFrom(london) / 1000); > > > > This looks like the the right track, however I need it so it's not > > just london and sydney, but anything which the user types in, so would > > this work?: > > > > var distance:Number; > > var from:LatLng = new LatLng(geocodes from the user search); > > var to:LatLng = new LatLng(geocodes from the user search); > > distance = to.distanceFrom(from) / 1000); > > distance_txt.htmlText = distance; > > > > How do I get the user search geocodes? > > Cheers, > > Will > > > > On Oct 23, 7:59 pm, Will <[EMAIL PROTECTED]> wrote: > > > > > Hi Pamela, > > > I would like the total distance of the route. > > > By alongside of it, I meant on the interface somewhere. for example, I > > > could create a new text element next to the steps which could display > > > it. or using the "step" text to display it. > > > > > Thanks for your time, > > > Will > > > > > On Oct 22, 4:45 pm, "pamela (Google Employee)" <[EMAIL PROTECTED]> > > > wrote: > > > > > > Hey Will- > > > > > > Do you want total distance of the route? Or distance along each > segment? > > > > > > By alongside of it, do you mean in the Flex UI or on the map? > > > > > > - pamela > > > > > > On Wed, Oct 22, 2008 at 6:33 PM, Will <[EMAIL PROTECTED]> > wrote: > > > > > > > Hi guys, > > > > > I've been working with the material to get directions from A to B, > but > > > > > how would I get it to display the distance along side of it? > > > > > > > code: > http://code.google.com/p/gmaps-samples-flash/source/browse/trunk/samp... > > > > > example: > http://gmaps-samples-flash.googlecode.com/svn/trunk/examples/Directio... > > > > > > > Any suggestions? > > > > > Thanks, > > > > > Will > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
