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 GLargeMapControl()); map.addControl(new GMapTypeControl()); map.addControl(new GOverviewMapControl(new GSize(120,120))); map.setCenter(new GPoint2(31.503629, 30.410156),2); map.enableDoubleClickZoom(); map.enableContinuousZoom(); map.enableScrollWheelZoom(); document.getElementById("map").appendChild(tooltip); tooltip.style.visibility="hidden"; var mm = new GMarkerManager(map); function parseZooms(doc,startlevel,endlevel) { var jsonData = eval("(" + doc + ")"); for (var i = 0; i < jsonData.markers.length; i++){ var zoom = jsonData.markers[i].z; var zoomlevel = zoom * 1; mm.addMarker(createZMarker(new GPoint2(jsonData.markers[i].a,jsonData.markers[i].o), jsonData.markers[i].n, jsonData.markers[i].n + ' (' + jsonData.markers[i].c + ')
Click to zoom', zoomlevel),startlevel,endlevel); } window.setTimeout(function (){ loadingPane('init',''); },500); } function parseObjects(doc) { var jsonData = eval("(" + doc + ")"); for (var i = 0; i < jsonData.markers.length; i++) { mm.addMarker(createTabbedMarker(new GPoint2(jsonData.markers[i].a,jsonData.markers[i].o), jsonData.markers[i].l, jsonData.markers[i].i),8,17); } window.setTimeout(function (){ loadingPane('init',''); },500); } function parseNotmapped(doc) { var jsonData = eval("(" + doc + ")"); for (var i = 0; i < jsonData.markers.length; i++) { mm.addMarker(createInfoMarker(new GPoint2(jsonData.markers[i].a,jsonData.markers[i].o), jsonData.markers[i].i, 'area'),8,17); } } GDownloadUrl("cache/json_countries.asp", function(data, responseCode) { parseZooms(data,0,3); }); var frontAreas; GEvent.addListener(map, "zoomend", function() { if( map.getZoom() >= 3 ) { if (!(frontAreas==1)) { GDownloadUrl("cache/json_areas.asp", function(data, responseCode) { loadingPane('init','Loading Areas, please wait.
This can take a few seconds.'); window.setTimeout(function (){ parseZooms(data,4,7); },500); }); frontAreas = 1; } } }); var frontObjects; GEvent.addListener(map, "zoomend", function() { if( map.getZoom() >= 7 ) { if (!(frontObjects==1)) { GDownloadUrl("cache/json_objects.asp", function(data, responseCode) { loadingPane('init','Loading Data Centers, please wait.
This can take a few seconds.'); window.setTimeout(function (){ parseObjects(data); },500); }); GDownloadUrl("cache/json_notmapped.asp", function(data, responseCode) {; parseNotmapped(data); }); frontObjects = 1; } } }); } else { alert("Browser compatibility error."); }