From b8426972bbda6aca2a4f29d6f5ab55429430f923 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 5 Dec 2008 15:11:33 +0000 Subject: moved button style to map.css --- map.css | 14 ++++++++++++++ map.js | 28 ++++++++-------------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/map.css b/map.css index 8741c61..c64beab 100644 --- a/map.css +++ b/map.css @@ -37,3 +37,17 @@ div.box { right: 10px; bottom: 10px; } + +div.btn { + color: #0000cc; + background-color: white; + border: 1px solid black; + font: small Arial; + text-decoration: underline; + text-align: center; + padding: 2px; + margin-bottom: 3px; + width: 10em; + cursor: pointer; +} + diff --git a/map.js b/map.js index 5a6a785..517d816 100644 --- a/map.js +++ b/map.js @@ -98,6 +98,8 @@ function onData(data, responseCode) { return alert("Fehler: Konnte die Daten nicht laden!\n(Server Antwort-Code: " + responseCode + ")"); } xmlData = GXml.parse(fetchData); + + // TODO: add data import } function addNewNodeText(point) { @@ -183,7 +185,7 @@ RulerControl.prototype.initialize = function(map) { dist= (parseInt(dist)/1000).toFixed(1) + " km"; } distText.data = dist; - poly = new GPolyline(line,'#FFFF00', 8, 1) + var poly = new GPolyline(line,'#FFFF00', 8, 1) poly.overlaytype = "ruler"; poly.overlaysubtype = "line"; map.addOverlay(poly); @@ -199,12 +201,12 @@ RulerControl.prototype.initialize = function(map) { } var container = document.createElement("div"); - var zoomInDiv = document.createElement("div"); - this.setButtonStyle_(zoomInDiv); - container.appendChild(zoomInDiv); + var btnDiv = document.createElement("div"); + btnDiv.className = "btn"; + container.appendChild(btnDiv); distText = document.createTextNode("Entfernung messen"); - zoomInDiv.appendChild(distText); - GEvent.addDomListener(zoomInDiv, "click", function() { + btnDiv.appendChild(distText); + GEvent.addDomListener(btnDiv, "click", function() { for(var o in overlays["ruler"]) { if(overlays["ruler"][o]) { clr(); @@ -234,17 +236,3 @@ RulerControl.prototype.initialize = function(map) { RulerControl.prototype.getDefaultPosition = function() { return new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(7, 7)); } - -RulerControl.prototype.setButtonStyle_ = function(button) { - button.style.textDecoration = "underline"; - button.style.color = "#0000cc"; - button.style.backgroundColor = "white"; - button.style.font = "small Arial"; - button.style.border = "1px solid black"; - button.style.padding = "2px"; - button.style.marginBottom = "3px"; - button.style.textAlign = "center"; - button.style.width = "10em"; - button.style.cursor = "pointer"; -} - -- cgit v1.2.1