Jump to content

Add 'Get Directions', to Google Map InfoWindow


wemustdesign

Recommended Posts

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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.