Адрес ул. Беломорская, д. 40, территория 15 таксопарка -- Москва
","standard.png"));
}
}
function resetmap() {
document.getElementById("directions").innerHTML = "";
document.getElementById("direction_feedback").innerHTML = "";
}
//route
var geocoder;
function map_start() {
var map;
var gdir = null;
var geocoder = null;
var addressMarker;
var from_address = document.getElementById("from_address").value;
var from_zipcode = document.getElementById("from_zipcode").value;
var from_town = document.getElementById("from_town").value;
var to_address = document.getElementById("to_address").value;
var from_start = "";
if(from_address=="Напишите адрес...") from_address="";
if(from_zipcode=="Область...") from_zipcode="";
if(from_town=="Город...") from_town="";
if(from_address) from_start = from_address + ","+"";
if(from_zipcode) from_start += from_zipcode+ ","+"";
if(from_town) from_start += from_town;
function initialize() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("googlemap"));
map.addControl(new GLargeMapControl());
map.addControl(new GScaleControl());
map.addControl(new GMapTypeControl());
map.enableScrollWheelZoom();
map.enableContinuousZoom();
map.enableDoubleClickZoom();
gdir = new GDirections(map, document.getElementById("directions"));
GEvent.addListener(gdir, "load", onGDirectionsLoad);
GEvent.addListener(gdir, "error", handleErrors);
setDirections(from_start, to_address, "ru_RU");
}
}
function setDirections(fromAddress, toAddress, locale) {
gdir.load("from: " + fromAddress + " to: " + toAddress,{ "locale": locale });
}
function handleErrors(){
if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS){
alert("Адрес не найден.");
load();
}else{
alert("Возникла неизвестная ошибка.");
load();
}
}
function onGDirectionsLoad(){
document.getElementById("direction_feedback").innerHTML= ""+"Назад в режим карты";
document.getElementById("directions").innerHTML = "";
}
initialize();
}
//print
var gAutoPrint = false;
function printSpecial()
{
if (document.getElementById != null)
{
var html = "\n\n";
html += "\n\n\n";
var printReadyElem = document.getElementById("directions");
if (printReadyElem != null)
{
html += "
";
html += printReadyElem.innerHTML;
}
else
{
alert("Could not find the printReady section in the HTML");
return;
}
html += "\n\n";
var printWin = window.open("","printSpecial", "width = 600");
printWin.document.open();
printWin.document.write(html);
printWin.document.close();
if (gAutoPrint)
printWin.print();
}
else
{
alert("Sorry, the print ready feature is only available in modern browsers.");
}
}