//Get directions: To here - From here' + '
Start address:
' + '
' + '' + '

'; from_htmls[i] = html + '

Get directions: To here - From here' + '
End address:' + '
' + '' + '

'; html = html + '

Get directions: To here - From here

'; GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); gmarkers[i] = marker; htmls[i] = html; i++; return marker; } map = new GMap2(document.getElementById("mapcontainer")); map.addControl(new GLargeMapControl()); map.addMapType(G_PHYSICAL_MAP); var hierarchy = new GHierarchicalMapTypeControl(); hierarchy.addRelationship(G_SATELLITE_MAP, G_HYBRID_MAP, null, true); map.addControl(hierarchy); // map.setCenter(new GLatLng(53.226112,-0.543995), 12); map.setCenter(new GLatLng(53.226112,-0.543995), 12); gdir=new GDirections(map, document.getElementById("directions")); var reasons=[]; reasons[G_GEO_SUCCESS] = "Success"; reasons[G_GEO_MISSING_ADDRESS] = "Missing Address: The address was either missing or had no value."; reasons[G_GEO_UNKNOWN_ADDRESS] = "Unknown Address: No corresponding geographic location could be found for the specified address, please try altering your address to be less specific (eg Nottingham)"; reasons[G_GEO_UNAVAILABLE_ADDRESS]= "Unavailable Address: The geocode for the given address cannot be returned due to legal or contractual reasons."; reasons[G_GEO_BAD_KEY] = "Bad Key: The API key is either invalid or does not match the domain for which it was given"; reasons[G_GEO_TOO_MANY_QUERIES] = "Too Many Queries: The daily geocoding quota for this site has been exceeded."; reasons[G_GEO_SERVER_ERROR] = "Server error: The geocoding request could not be successfully processed, please try again shortly."; reasons[G_GEO_BAD_REQUEST] = "A directions request could not be successfully parsed."; reasons[G_GEO_MISSING_QUERY] = "No query was specified in the input."; reasons[G_GEO_UNKNOWN_DIRECTIONS] = "Google Maps is having trouble finding a route between the two points, please try a different address."; GEvent.addListener(gdir, "error", function() { var code = gdir.getStatus().code; var reason="Code "+code; if (reasons[code]) { reason = reasons[code] } alert("Google Maps is experiencing the following error, "+reason); loadMap(true); }); var lat = '53.226112'; var lng = '-0.543995'; var point = new GLatLng(lat,lng); var html = '

Address:

Brayford Wharf E
Lincoln, LN5 7BG

'; var label = 'The Junxion, Lincoln'; var marker = createMarker(point,label,html); map.addOverlay(marker); html = html + '

Get directions: To here - From here

'; marker.openInfoWindowHtml(html); } else { alert("Sorry, the Google Maps API is not compatible with this browser"); } } function tohere(i) { gmarkers[i].openInfoWindowHtml(to_htmls[i]); } function fromhere(i) { gmarkers[i].openInfoWindowHtml(from_htmls[i]); } function getDirections() { var saddr = document.getElementById("saddr").value var daddr = document.getElementById("daddr").value gdir.load("from: "+saddr+" to: "+daddr); map.clearOverlays(); document.getElementById('backtomapT').style.display='block'; } //]]>