diff --git a/static/js/index/index.js b/static/js/index/index.js index 3249d70..22974a5 100644 --- a/static/js/index/index.js +++ b/static/js/index/index.js @@ -124,6 +124,20 @@ $(document).ready(function () { console.log("No event source_log"); } }); + + $( "#rotation_wait_time_selector" ).change(function() { + var sel = parseInt($( this ).val()); + if(isNaN(sel)) { + rotation_wait_time = 0; + } else { + rotation_wait_time = sel; + } + var old = ROTATIONWAITTIME; + ROTATIONWAITTIME = 1000*rotation_wait_time; //seconds + if(old == 0) { + mapEventManager._timeoutRotate = setTimeout(function(){ mapEventManager.rotateMap(); }, ROTATIONWAITTIME); + } + }); }); diff --git a/static/js/index/index_map.js b/static/js/index/index_map.js index 764d4bd..27872e6 100644 --- a/static/js/index/index_map.js +++ b/static/js/index/index_map.js @@ -1,10 +1,10 @@ const MAXNUMCOORD = 100; const PINGWAITTIME = 1000*1; //1s const MAXIMGROTATION = max_img_rotation; -const ROTATIONWAITTIME = 1000*rotation_wait_time; //seconds const OSMURL='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; const OSMATTRIB='Map data © OpenStreetMap contributors'; +var ROTATIONWAITTIME = 1000*rotation_wait_time; //seconds var myOpenStreetMap = L.map('feedDivMap1').setView([0, 0], 1); var osm = new L.TileLayer(OSMURL, {minZoom: 0, maxZoom: 17}).addTo(myOpenStreetMap); @@ -87,7 +87,10 @@ class MapEventManager { mapEvent.marker.bindPopup(mapEvent.textMarker).openPopup(); $("#textMap1").fadeOut(400, function(){ $(this).text(mapEvent.text); }).fadeIn(400); - this._timeoutRotate = setTimeout(function(){ mapEventManager.rotateMap(); }, ROTATIONWAITTIME); + if(ROTATIONWAITTIME != 0) { + console.log(ROTATIONWAITTIME); + this._timeoutRotate = setTimeout(function(){ mapEventManager.rotateMap(); }, ROTATIONWAITTIME); + } } ping() { diff --git a/templates/index.html b/templates/index.html index abeff8e..1a641fa 100644 --- a/templates/index.html +++ b/templates/index.html @@ -78,14 +78,17 @@ small {
- - -
No map - +
+ No map +
+ 1/{{ max_img_rotation }} + +