summaryrefslogtreecommitdiff
path: root/map.js
diff options
context:
space:
mode:
authorChristian Pointner <equinox@ffgraz.net>2013-12-30 02:24:32 +0000
committerChristian Pointner <equinox@ffgraz.net>2013-12-30 02:24:32 +0000
commit0cf4d26fa38c09d4ad7fe4259e89eeb9c5f08c52 (patch)
tree6d0abf86a5e2757e37bb8e7812496d47cbefe38c /map.js
parent868d5d661987483ac10214216a2ceda5d0c1cd7a (diff)
added extended reload control feature
Diffstat (limited to 'map.js')
-rw-r--r--map.js36
1 files changed, 14 insertions, 22 deletions
diff --git a/map.js b/map.js
index f2aa9aa..56212d6 100644
--- a/map.js
+++ b/map.js
@@ -58,7 +58,7 @@ function initialize(lat, lng, res) {
countboxText = document.createTextNode("Aktiv: 0");
countbox.appendChild(countboxText);
-//##// reloadcon.started();
+ reloadcon.started();
$.get( "data.php",onData);
}
@@ -73,8 +73,9 @@ function onMapClick(mouse_event)
//##// reloadcon.finished();
//##// return alert("Fehler: Konnte die Daten nicht laden!\n(Server Antwort-Code: " + responseCode + ")");
//##// }
-//##// reloadcon.loaded();
function onData(xmlData) {
+ reloadcon.loaded();
+
for(var loc in overlays["locations"]) {
overlays["locations"][loc].setMap(null);
}
@@ -99,7 +100,7 @@ function onData(xmlData) {
countboxText.data = "Aktiv: " + count;
}
-//##// reloadcon.finished();
+ reloadcon.finished();
}
function drawLocations(xmlData) {
@@ -527,7 +528,7 @@ function onFFLogin(xmlData) {
if(status[0].getAttribute("code") == "logged_in") {
var username = xmlData.getElementsByTagName("username")[0].getAttribute("name");
showFFLogout(username);
-//##// reloadcon.started();
+ reloadcon.started();
$.get( "data.php",onData);
}
}
@@ -559,7 +560,7 @@ function onFFLogout(xmlData) {
}
else {
showFFLogin();
-//##// reloadcon.started();
+ reloadcon.started();
$.get("data.php", onData);
}
}
@@ -597,30 +598,21 @@ function ReloadControl(controlDiv, map) {
controlDiv.appendChild(controlUI);
var controlText = document.createElement('div');
- controlText.innerHTML = '<strong>Daten neu laden</strong>';
+ controlText.innerHTML = 'Daten neu laden';
controlUI.appendChild(controlText);
google.maps.event.addDomListener(controlUI, 'click', function() {
-// reloadcon.started();
+ controlText.innerHTML = 'wird geladen...';
$.get("data.php", onData);
});
-}
-
-// ReloadControl.prototype.started = function() {
-// btnText.data = "wird geladen...";
-// }
-// ReloadControl.prototype.loaded = function() {
-// btnText.data = "wird verarbeitet...";
-// }
-
-// ReloadControl.prototype.finished = function() {
-// btnText.data = "Daten neu laden";
-// }
+ var cntrl = new Object();
+ cntrl.started = function() { controlText.innerHTML = 'wird geladen...'; }
+ cntrl.loaded = function() { controlText.innerHTML = 'wird verarbeitet...'; }
+ cntrl.finished = function() { controlText.innerHTML = 'Daten neu laden'; }
+ return cntrl;
+}
-// ReloadControl.prototype.getDefaultPosition = function() {
-// return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(7, 7));
-// }
//##//function RulerControl() {