Our app uses OpenLayers with the Google Map layer. I want to know if it is possible to render directions using the DirectionsRenderer api of Google Maps on this OpenLayers map?
The example here - http://code.google.com/apis/maps/documentation/javascript/services.html#Directions - works fine in a stand-alone environment. If we try to integrate it with OpenLayers, the directions don't get rendered.
Any help?
Thanks, Sridhar
OpenLayers doesn't wrap Directions functionality of Google Maps. You can though still use Google Maps layer in OpenLayers and make requests to Directions Services using Google's API.
If you make request like in example on their documentation page:
});
you will notice that result.routes.overview_path contains all points for the route. Then you can use OpenLayers.Layers.Vector to render this route in a separate layer above Google Maps layer.