wemustdesign Posted August 6, 2009 Share Posted August 6, 2009 I am trying to add 'Get Directions to Here' in my info window in Google Maps. I have followed sample code but don't really know what I am doing. This is the code I am using at the moment, this simply centers the map, creates an info window and displays some text. Can anybody point me in the right direction of what I have to do next? <script type="text/javascript"> function initialize() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map_canvas")); map.setCenter(new GLatLng(54.988764 , -1.436700), 17); map.openInfoWindow(map.getCenter(), document.createTextNode("Get directions here")); map.setMapType(G_HYBRID_MAP); map.setUIToDefault(); var point = new GLatLng(54.988764 , -1.436700); map.addOverlay(new GMarker(point)); } } </script> Quote Link to comment https://forums.phpfreaks.com/topic/169064-add-get-directions-to-google-map-infowindow/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.