If you do a geocoding in the address typed by user, you'll had the GLatLng correspondent to this address. What you need to do now is calculate the distance between the GLatLng and the start or end or a intermediate point in the polyline. Polyline had a getVertex(index) wich return a GLatLng object and its all you need to calculate distance (between 2 points in the earth)
On Tue, Apr 13, 2010 at 1:26 PM, kasa <[email protected]> wrote: > Thanks for you reply. Now I have the polyline(added using lat/long) > What I want now is for the user to put in an address in the enter > address field, and the distance between that address entered and the > polyline should be displayed in an information window. > > On Apr 12, 3:28 pm, Andrew Leach <[email protected]> > wrote: > > On Apr 12, 10:17 pm, kasa <[email protected]> wrote: > > > > > No. I added another map to the google base map. It is a powerline > > > route. Now I want to be able to calculate thedistancebetween any > > > location the user input into the find address input box and the > > > powerline route that I have overlaid on the google base map. > > > > To do that, the API needs to know both ends of thedistance: one is > > the point you geocode (so that's available); the other is the route of > > the power line. How are you going to get the API to use that route if > > all you have done is overlay an image? You need something concrete > > within the API, like a polyline. Create a polyline on the Google map > > which follows the route, and you can easily find thedistancefrom > > your geocoded point. And you won't need the overlaid map image either. > > -- > You received this message because you are subscribed to the Google Groups > "Google Maps API" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-maps-api%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-maps-api?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google Maps API" 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?hl=en.
