diff options
Diffstat (limited to 'map3.js')
-rw-r--r-- | map3.js | 48 |
1 files changed, 4 insertions, 44 deletions
@@ -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("<a href=\"http://www.openstreetmap.org/\">OpenStreetMap</a>"); -//##// 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<mt.length; i++) { -//##// mt[i].getMinimumResolution = function() {return 0;} -//##// mt[i].getMaximumResolution = function() {return 22;} -//##// } - //##// geocoder = new google.maps.Geocoder(); var countbox = document.getElementById("countbox"); @@ -108,13 +79,6 @@ function onAddOverlay(overlay) { } } -function onZoom(oldLevel, newLevel) -{ - if(newLevel > 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 = '<div id="linkbox" class="box" style="border-color: ' + link.color + '">'; if((links[link.name].frequence !== "undef") && (links[link.name].frequence !== "")){ @@ -449,11 +412,8 @@ function makeIcon(type) { } return { 'url': url, - // This marker is 20 pixels wide by 32 pixels tall. size: new google.maps.Size(12, 20), - // The origin for this image is 0,0. origin: new google.maps.Point(0,0), - // The anchor for this image is the base of the flagpole at 0,32. anchor: new google.maps.Point(6, 20) }; } |