if (GBrowserIsCompatible()) { function GPoint2(x,y) { return new GLatLng(x,y); } function jumpTo(selectId){ var sc = document.getElementById(selectId).value.split(","); map.setCenter(new GPoint2(sc[0],sc[1]),Number(sc[2])); } function showTooltip(marker) { tooltip.innerHTML = marker.tooltip; var point=map.getCurrentMapType().getProjection().fromLatLngToPixel(map.getBounds().getSouthWest(),map.getZoom()); var offset=map.getCurrentMapType().getProjection().fromLatLngToPixel(marker.getPoint(),map.getZoom()); var anchor=marker.getIcon().iconAnchor; var width=marker.getIcon().iconSize.width; var pos = new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(offset.x - point.x - anchor.x + width,- offset.y + point.y +anchor.y)); pos.apply(tooltip); tooltip.style.visibility="visible"; } function createZMarker(point,name,html,zoom) { var marker = new GMarker(point, iconZ); marker.tooltip = '
'+html+'
'; GEvent.addListener(marker, "click", function() { map.setCenter(point, zoom); }); GEvent.addListener(marker,"mouseover", function() { showTooltip(marker); }); GEvent.addListener(marker,"mouseout", function() { tooltip.style.visibility="hidden" }); return marker; } function getObject(objectId) { var request = GXmlHttp.create(); request.open("GET", '/ajax/map.asp?id=' + objectId, false); request.send(null); objectResult = request.responseText; return objectResult; } function getName(objectId) { var request = GXmlHttp.create(); request.open("GET", '/ajax/map.asp?id=' + objectId, true); request.onreadystatechange = function() { if (request.readyState == 4) { document.getElementById(objectId).innerHTML = request.responseText; } } request.send(null); } function getArea(areaId,type) { var request = GXmlHttp.create(); request.open("GET", '/ajax/notmapped.asp?id=' + areaId + '&type=' + type, false); request.send(null); objectResult = request.responseText; return objectResult; } function createTabbedMarker(point,link,itype) { if (itype == 0) { var marker = new GMarker(point,icon0); } else if (itype == '0p') { var marker = new GMarker(point,icon0p); } else if (itype == 1) { var marker = new GMarker(point,icon1); } else if (itype == '1p') { var marker = new GMarker(point,icon1p); } else if (itype == 2) { var marker = new GMarker(point,icon2); } else if (itype == '2p') { var marker = new GMarker(point,icon2p); } var label2 = 'Description'; if (itype == 2) { label2 = 'Tenants' } marker.tooltip = ''; GEvent.addListener(marker, "click", function() { var ajax1 = getObject('' + link + 'a1'); var ajax2 = getObject('' + link + 'a2'); marker.openInfoWindowTabsHtml([new GInfoWindowTab('Details','
' + ajax1 + '
'), new GInfoWindowTab(label2,'
' + ajax2 + '
')]); }); GEvent.addListener(marker,"mouseover", function() { if (eval("document.getElementById('"+link+"a3')")) { eval("document.getElementById('"+link+"a3')").style.visibility="visible" } else { var ajax3 = getName('' + link + 'a3'); showTooltip(marker); } }); GEvent.addListener(marker,"mouseout", function() { eval("document.getElementById('"+link+"a3')").style.visibility="hidden" }); return marker; } function createInfoMarker(point,link,type) { var marker = new GMarker(point,iconi); marker.tooltip = ''; GEvent.addListener(marker, "click", function() { var ajax1 = getArea(link,type); marker.openInfoWindowHtml('
' + ajax1 + '
'); }); GEvent.addListener(marker,"mouseover", function() { if (eval("document.getElementById('"+link+"html')")) { eval("document.getElementById('"+link+"html')").style.visibility="visible" } else { showTooltip(marker); } }); GEvent.addListener(marker,"mouseout", function() { eval("document.getElementById('"+link+"html')").style.visibility="hidden" }); return marker; } function loadingPane(channel,message){ messages[channel]=message; if (!messages['init']){ messages['init']=''; } var tmpstr = ''; if (messages['init'] != ''){ tmpstr += messages['init']+"
"; } document.getElementById("div_loading").innerHTML = '
'+tmpstr+'
'; if (messages['init'] != ''){ document.getElementById("div_loading").style.visibility="visible"; } else { document.getElementById("div_loading").style.visibility="hidden"; } } var iconi = new GIcon(G_DEFAULT_ICON); iconi.image = "/img/iconi.png"; iconi.iconSize = new GSize(15, 26); iconi.shadowSize = new GSize(22, 20); iconi.iconAnchor = new GPoint(6, 20); iconi.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; var icon0 = new GIcon(G_DEFAULT_ICON); icon0.image = "/img/icon0.png"; icon0.iconSize = new GSize(12, 20); icon0.shadowSize = new GSize(22, 20); icon0.iconAnchor = new GPoint(6, 20); icon0.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; var icon1 = new GIcon(G_DEFAULT_ICON); icon1.image = "/img/icon1.png"; icon1.iconSize = new GSize(12, 20); icon1.shadowSize = new GSize(22, 20); icon1.iconAnchor = new GPoint(6, 20); icon1.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; var icon2 = new GIcon(G_DEFAULT_ICON); icon2.image = "/img/icon2.png"; icon2.iconSize = new GSize(12, 20); icon2.shadowSize = new GSize(22, 20); icon2.iconAnchor = new GPoint(6, 20); icon2.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; var icon0p = new GIcon(G_DEFAULT_ICON); icon0p.image = "/img/icon0p.png"; icon0p.iconSize = new GSize(16, 24); icon0p.shadowSize = new GSize(22, 20); icon0p.iconAnchor = new GPoint(6, 20); icon0p.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; var icon1p = new GIcon(G_DEFAULT_ICON); icon1p.image = "/img/icon1p.png"; icon1p.iconSize = new GSize(16, 24); icon1p.shadowSize = new GSize(22, 20); icon1p.iconAnchor = new GPoint(6, 20); icon1p.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; var icon2p = new GIcon(G_DEFAULT_ICON); icon2p.image = "/img/icon2p.png"; icon2p.iconSize = new GSize(16, 24); icon2p.shadowSize = new GSize(22, 20); icon2p.iconAnchor = new GPoint(6, 20); icon2p.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; var iconP = new GIcon(G_DEFAULT_ICON); iconP.image = "/img/iconP.png"; iconP.iconSize = new GSize(6, 10); iconP.shadowSize = new GSize(12, 10); iconP.iconAnchor = new GPoint(3, 10); iconP.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; var iconZ = new GIcon(G_DEFAULT_ICON); iconZ.image = "/img/zoom.png"; iconZ.iconSize = new GSize(20, 20); iconZ.shadowSize = new GSize(22, 20); iconZ.iconAnchor = new GPoint(6, 20); iconZ.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; var map = new GMap2(document.getElementById("map")); var tooltip = document.createElement("div"); var tip = document.createElement("div"); tip.setAttribute("id","div_loading"); document.getElementById("map").appendChild(tip); var pos = new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(0,0)); pos.apply(document.getElementById("div_loading")); tip.style.visibility="hidden"; messages = new Array(); map.addControl(new GSmallMapControl()); map.setCenter(new GPoint2(41.037757, 28.932307),12); map.enableDoubleClickZoom(); map.enableContinuousZoom(); map.enableScrollWheelZoom(); document.getElementById("map").appendChild(tooltip); tooltip.style.visibility="hidden"; var mm = new GMarkerManager(map); mm.addMarker(createTabbedMarker(new GPoint2(41.037757,28.932307), 456, 1),0,17); } else { alert("Browser compatibility error."); }