I need your suggestion. I am creating a web application where I need to find if particular city’s exist along my path. I am using google API to get direction along path,but it does not return the cities between.
For Example if I am travelling from A – > D , I like to know whether C ->D exist along my path A – > D . If I know the cities between A -> D , I can easily do that .But google API doesnt reveal that . Does any one have any other better suggestion . Thanks
The name of a city isn’t very accurate, you’ll need a LatLng for the city.
Based on a LatLng the method
isLocationOnEdge()of the geometry-library allows you to determine if the LatLng(city) lies on (or is near) the polyline defined for a route:responsehas to be a directionsResult, the last parameter is a tolerancehttp://jsfiddle.net/doktormolle/DXCH8/