diff options
author | Christian Franke <nobody@nowhere.ws> | 2013-12-12 16:42:24 +0100 |
---|---|---|
committer | Christian Franke <nobody@nowhere.ws> | 2013-12-12 16:42:24 +0100 |
commit | 58135d49bfd435ea08713adee5f8179913bbae10 (patch) | |
tree | 2c0eeb6f1bc1bb596e9cf2204a15fbb804b50b79 /web/js | |
parent | fb2bde41ac04ee93c4dd238dcb3e812ac2d15356 (diff) |
Add icons for search, loading screen
Diffstat (limited to 'web/js')
-rw-r--r-- | web/js/eventmap.js | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/web/js/eventmap.js b/web/js/eventmap.js index 376cba5..ac83f74 100644 --- a/web/js/eventmap.js +++ b/web/js/eventmap.js @@ -28,6 +28,8 @@ function eventmap_send_update() { data: JSON.stringify(update_doc), processData: false, dataType: 'json' + }).fail(function(){ + alert("Couldn't send update to server. It is not saved."); }); } @@ -235,6 +237,7 @@ function marker_labels_calc_nohide(e) { } $(function() { + $("#progress").html("Initializing map..."); map = L.map('map', { center: new L.LatLng(70,-50), contextmenu: true, @@ -318,7 +321,9 @@ $(function() { /* update will be sent by "rename_marker" */ }); + $("#progress").html("Retrieving layer info..."); $.getJSON('js/layers.json', function(data) { + $("#progress").html("Creating layers..."); var first_layer = true; $.each(data, function(layer_index, layer_info) { var layer_path; @@ -352,10 +357,19 @@ $(function() { }); layer_control.addTo(map); + $("#progress").html("Loading marker info..."); $.ajax({ url: 'api/markers/get' - }).done(eventmap_process_update).fail(function() { - alert("Couldn't load marker info from server!"); + }).done(function(data) { + $("#progress").html("Processing marker info..."); + eventmap_process_update(data); + $("#progress").html("Loading complete."); + setTimeout(function() { + $("#overlay").hide(); + }, 300); + }).fail(function() { + $("#progress").html("Error loading marker info," + + " please retry."); }); }); }); |