From 8f4c420a1bbfadf0625555362b984f466071639c Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 29 Dec 2013 17:28:09 +0000 Subject: whitespace cleanups fixed lines[] --- map3.js | 92 ++++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/map3.js b/map3.js index fe1ccdd..e76cfb7 100644 --- a/map3.js +++ b/map3.js @@ -21,12 +21,12 @@ function initialize(lat, lng, res) { var mapOptions = { center: new google.maps.LatLng(lat, lng), zoom: res, - streetViewControl: false, + streetViewControl: false, mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControlOptions: { mapTypeIds: [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.HYBRID , google.maps.MapTypeId.SATELLITE , google.maps.MapTypeId.TERRAIN ], - style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR, - } + style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR, + } }; map = new google.maps.Map(document.getElementById("map"), mapOptions); @@ -59,18 +59,18 @@ function initialize(lat, lng, res) { //##// map.addControl(new GSmallMapControl(), new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(10,20))); //##// 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); - + 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"); document.getElementById("map").appendChild(lineinfo); lineinfo.style.visibility = "hidden" - + dnsinfo = document.createElement("div"); document.getElementById("map").appendChild(dnsinfo); dnsinfo.style.visibility = "hidden" - + //##// var mt = map.getMapTypes(); //##// for (var i=0; i'+dnsname[i]+''; } - } - } + } + } html += ''; html += ''; var infowindow = new google.maps.InfoWindow({content: html}); @@ -246,8 +246,8 @@ function onLineClick(line,latlng) { } html += ' Router: '+dnsfrom[i]+''; } - } - + } + if(line.dnsto){ var dnsto = line.dnsto.split(";"); for (var i = 0;i < dnsto.length; ++i){ @@ -281,7 +281,7 @@ function drawLinks(xmlData) { state="Unbekannt" var id = element[i].getAttribute("from") + "-" + element[i].getAttribute("to"); links[id] = new Link(element[i]); - + var line = new google.maps.Polyline({path: [links[id].frompoint, links[id].topoint], strokeColor: makeColor(Math.floor(links[id].value)), strokeWeight: makeWeight(Math.floor(links[id].value))}); line.name = id; line.textcolor = textcolor; @@ -292,14 +292,14 @@ function drawLinks(xmlData) { line.dnsto = element[i].getAttribute("dnsto"); 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, "mouseout", function() { lineinfo.style.visibility = "hidden"; }); 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)}); - +// google.maps.event.addListener(line, "click", function(latlng){map.openInfoWindowHtml(latlng, message)}); + line.setMap(map); - lines.push(marker); - } + lines.push(line); + } if(document.visibleform.elements["defaultroute"].checked) { toggleVisible("defaultroute"); } @@ -361,7 +361,7 @@ function drawLinks(xmlData) { toggleVisible("5channel"); } if(document.visibleform.elements["undef"].checked) { - toggleVisible("undef"); + toggleVisible("undef"); } } function showLinkInfo(link, point) { @@ -370,7 +370,7 @@ function showLinkInfo(link, point) { html += 'Frequenz: ' + links[link.name].frequence + '
'; } else { html += 'Frequenz: undef
'; - } + } if(links[link.name].channel !== "undef") { html += 'Kanal: ' + links[link.name].channel + '
'; } else { @@ -448,13 +448,13 @@ function makeIcon(type) { case 'offline': url = "./img/marker_offline.png"; break; } 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) + '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) }; } @@ -476,7 +476,7 @@ function toggleVisible(element) { document.visibleform.elements["channel12"].checked=false; document.visibleform.elements["channel13"].checked=false; document.visibleform.elements["5channel"].checked=false; - document.visibleform.elements["undef"].checked=false; + document.visibleform.elements["undef"].checked=false; } if (element=='2.4channel'){ document.visibleform.elements["channel1"].checked=document.visibleform.elements["2.4channel"].checked; @@ -568,16 +568,16 @@ function addNewNodeText(point) { return html; } -function setNewMarker(point) { +function setNewMarker(point) { /* var marker = new GMarker(point,{icon: makeIcon('newnode'), draggable: true}); - google.maps.event.addListener(marker, "dragstart", + google.maps.event.addListener(marker, "dragstart", function() { this.autoclosed = true; this.closeInfoWindow(); }); - google.maps.event.addListener(marker, "dragend", + google.maps.event.addListener(marker, "dragend", function(point) { this.openInfoWindowHtml(addNewNodeText(point)); }); @@ -596,13 +596,13 @@ function setNewMarker(point) { map.addOverlay(marker); marker.openInfoWindowHtml(addNewNodeText(point)); */ - var marker = new GMarker(point,makeIcon('newnode')); - google.maps.event.addListener(marker,"infowindowclose",function () { + var marker = new GMarker(point,makeIcon('newnode')); + google.maps.event.addListener(marker,"infowindowclose",function () { map.removeOverlay(marker); - }); - - map.addOverlay(marker); - marker.openInfoWindowHtml(addNewNodeText(point)); + }); + + map.addOverlay(marker); + marker.openInfoWindowHtml(addNewNodeText(point)); } function fflogin(username, password) { @@ -681,7 +681,7 @@ function showFFLogout(username) { function showAddress(address) { if (geocoder) { // address += ", Graz, Austria"; - geocoder.getLatLng(address, + geocoder.getLatLng(address, function(point) { if (!point) { alert(address + " nicht gefunden"); @@ -707,7 +707,7 @@ function showAddress(address) { //##// btnText = document.createTextNode("Daten neu laden"); //##// btnDiv.appendChild(btnText); //##// google.maps.event.addDomListener(btnDiv, "click", function() { -//##// reloadcon.started(); +//##// reloadcon.started(); //##// GDownloadUrl("data.php", onData); //##// }); //##// @@ -782,7 +782,7 @@ function showAddress(address) { //##// return; //##// } //##// } -//##// +//##// //##// btnText.data = "Messung beenden"; //##// distText.data = "Entfernung: 0 m"; //##// distBox.style.visibility = "visible"; -- cgit v1.2.1