From 035f9f75bdde891911ca3a7e7d324b59a2997f08 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 29 Dec 2013 17:41:37 +0000 Subject: cleanups reenable visibox --- map3.js | 48 ++++-------------------------------------------- 1 file changed, 4 insertions(+), 44 deletions(-) diff --git a/map3.js b/map3.js index e76cfb7..51ae3be 100644 --- a/map3.js +++ b/map3.js @@ -1,8 +1,7 @@ var map = null; var linkinfo; -var physicalMaxLevel; var geocoder = null; -//##//var reloadcon = null; +var reloadcon = null; var countboxText = null; var overlays = new Array(); overlays["new"] = null; @@ -11,11 +10,9 @@ overlays["locations"] = new Array(); overlays["links"] = new Array(); var locations = new Array(); var links = new Array(); -var lines = new Array(); -var markers = new Array(); function initialize(lat, lng, res) { - $('#visibox').hide(); +// $('#visibox').hide(); $('#southeastcontainer').hide(); google.maps.visualRefresh=true; var mapOptions = { @@ -34,25 +31,6 @@ function initialize(lat, lng, res) { //##// map.disableDoubleClickZoom(); //##// map.enableScrollWheelZoom(); -//##// // openStreetMap -//##// var copyOSM = new GCopyrightCollection("OpenStreetMap"); -//##// var copyOGDGraz = new GCopyrightCollection("Open Government Data Graz"); -//##// copyOSM.addCopyright(new GCopyright(1, new GLatLngBounds(new google.maps.LatLng(-90,-180), new google.maps.LatLng(90,180)), 0, " ")); -//##// var tilesOsmarender = new GTileLayer(copyOSM, 1, 17, {tileUrlTemplate: 'http://tah.openstreetmap.org/Tiles/tile/{Z}/{X}/{Y}.png'}); -//##// var mapOsmarender = new GMapType([tilesOsmarender], G_NORMAL_MAP.getProjection(), "openSM", {urlArg: 'y'}); -//##// map.addMapType(mapOsmarender); -//##// var tilesMapnik = new GTileLayer(copyOSM, 1, 17, {tileUrlTemplate: 'http://tile.openstreetmap.org/{Z}/{X}/{Y}.png'}); -//##// var mapMapnik = new GMapType([tilesMapnik], G_NORMAL_MAP.getProjection(), "Mapnik", {urlArg: 'x'}); -//##// map.addMapType(mapMapnik); -// var tilesOpenGeoServer = new GTileLayer(copyOGDGraz, 1, 17, {tileUrlTemplate: 'http://services.opengeoserver.org/tiles/1.0.0/globe.aerial_EPSG3857/${Z}/${X}/${Y}.png?origin=nw'}); -// var mapOpenGeoServer = new GMapType([tilesOpenGeoServer], G_NORMAL_MAP.getProjection(), "OpenGeoServer"); -// map.addMapType(mapOpenGeoServer); - -//##// physicalMaxLevel = map.getCurrentMapType().getMaximumResolution(); -//##// if(res > physicalMaxLevel) { -//##// map.setMapType(G_NORMAL_MAP); -//##// map.setZoom(res); -//##// } //##// map.addControl(new RulerControl()); //##// reloadcon = new reloadcontrol(); //##// map.addcontrol(reloadcon); @@ -60,7 +38,6 @@ function initialize(lat, lng, res) { //##// map.addControl(new GMapTypeControl(), new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(50,10))); google.maps.event.addListener(map, "addoverlay", onAddOverlay); - google.maps.event.addListener(map, "zoomend", onZoom); google.maps.event.addListener(map, "click", onMapClick); lineinfo = document.createElement("div"); @@ -71,12 +48,6 @@ function initialize(lat, lng, res) { document.getElementById("map").appendChild(dnsinfo); dnsinfo.style.visibility = "hidden" -//##// var mt = map.getMapTypes(); -//##// for (var i=0; i physicalMaxLevel) { - // map.setMapType(G_SATELLITE_MAP); - } -} - function onMapClick(overlay, point) { if(!overlay) { @@ -174,7 +138,6 @@ function drawLocations(xmlData) { google.maps.event.addListener(marker, "click", onLocationClick); //##// map.addOverlay(marker); marker.setMap(map); - markers.push(marker); } if(document.visibleform.elements["offline"].checked) { toggleVisible("offline"); @@ -293,12 +256,11 @@ function drawLinks(xmlData) { line.Routerfrom = element[i].getAttribute("from"); line.Routerto = element[i].getAttribute("to"); google.maps.event.addListener(line, "mouseout", function() { lineinfo.style.visibility = "hidden"; }); - google.maps.event.addListener(line, "mouseover", function(point) { showLinkInfo(this, point)}); +// google.maps.event.addListener(line, "mouseover", function(point) { showLinkInfo(this, point)}); google.maps.event.addListener(line, "click", function(point){onLineClick(this,point)}); // google.maps.event.addListener(line, "click", function(latlng){map.openInfoWindowHtml(latlng, message)}); line.setMap(map); - lines.push(line); } if(document.visibleform.elements["defaultroute"].checked) { toggleVisible("defaultroute"); @@ -364,6 +326,7 @@ function drawLinks(xmlData) { toggleVisible("undef"); } } + function showLinkInfo(link, point) { var html = '