@@ -28,15 +28,14 @@
document.dispatchEvent(customEvent);
}
- function action(topic) {
- var output = document.getElementById('output');
- output.textContent = {"one": "1", "two": "2", "three": "3"}[topic];
- }
function latlon(lat,lon) {
var output = document.getElementById('output');
- output.textContent = lat+lon;
+ //output.textContent = lat + " " + lon;
latitude = lat;
longitude = lon;
+ //map.panTo([lat, lon]);
+ map.panTo([latitude, longitude]);
+ getLoc();
}
</script>
@@ -53,11 +52,12 @@
<!--p style="text-align:left; position: absolute;top: 0; left: 0; right: 0; height: 50px;">
<input type="radio" name="kind" checked="checked" onchange="setKind('radar')">Radar (Past + Future) <input type="radio" name="kind" onchange="setKind('satellite')">Infrared Satellite -->
+<!--div id="output">Blah</div -->
<div id="timestamp" style="text-align:center; position: absolute;top: 5px; left: 0; right: 0; height: 80px;">>>: Tue Sep 13 2022 11:20:00</div>
-
<ul style="text-align:right; position: absolute; top: 25px; right:10px; height: 50px;">
+ <li><input style="padding: 5px; width: 50px; height: 30px;" type="button" onclick="getLoc(); return;" value="Locate"></li>
<li><input style="padding: 5px; width: 30px; height: 30px;" type="button" onclick="stop(); showFrame(animationPosition - 1); return;" value="<"></li>
- <li><input style="padding: 5px; height: 30px;" type="button" onclick="playStop();" value="Play / Stop"></li>
+ <li><input style="padding: 5px; width: 40px; height: 30px;" type="button" onclick="playStop();" value=" > / = "></li>
<li><input style="padding: 5px; width: 30px; height: 30px;" type="button" onclick="stop(); showFrame(animationPosition + 1); return;" value=">"></li>
<!-- <li><select id="colors" onchange="setColors(); return;">
<option value="0">Black and White Values</option>
@@ -79,14 +79,15 @@
<script>
//var map = L.map('mapid').setView([52.520008, 13.404954], 9);
// sadly does not work
- //getLoc();
if ( longitude == null ) longitude = 13.404954;
if ( latitude == null ) latitude = 52.520008;
var map = L.map('mapid').setView([latitude, longitude], 9);
+
// this depends on Location being available.
- map.locate({setView: true, maxZoom: 10});
+ // map.locate({setView: true, maxZoom: 10});
+ //map.panTo([50, 30]);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attributions: 'Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors'
@@ -115,10 +116,10 @@
var loadedTilesCount = 0;
function startLoadingTile() {
- loadingTilesCount++;
+ loadingTilesCount++;
}
function finishLoadingTile() {
- // Delayed increase loaded count to prevent changing the layer before
+ // Delayed increase loaded count to prevent changing the layer before
// it will be replaced by next
setTimeout(function() { loadedTilesCount++; }, 250);
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-dwd-0.9.4.tar.bz2/qml/pages/RadarView.qml
^
|
@@ -60,7 +60,7 @@
active: true
onPositionChanged: {
var coord = positionSource.position.coordinate;
- if (debug) console.log("Coordinate:", coord.longitude, coord.latitude);
+ //if (debug) console.log("Coordinate:", coord.longitude, coord.latitude);
//lat = coord.latitude;
//lon = coord.longitude;
}
@@ -92,20 +92,28 @@
onViewInitialized: {
webview.loadFrameScript(Qt.resolvedUrl("../html/framescript.js"));
- webview.addMessageListener("webview:action")
+ webview.addMessageListener("webview:action");
+ webview.runJavaScript("return latlon('" + lat + "','" + lon + "')");
}
+ on_PageOrientationChanged: {
+ if ( data.topic != lon ) {
+ webview.runJavaScript("return latlon('" + lat + "','" + lon + "')");
+ }
+
+ }
+
onRecvAsyncMessage: {
if (debug) console.debug(message)
- //webview.runJavaScript("return latlon('" + lat + "," +lon + "')")
+ //webview.runJavaScript("return latlon('" + lat + "','" + lon + "')");
switch (message) {
+ case "embed:contentOrientationChanged":
+ break
case "webview:action":
- //label.text = {"four": "4", "five": "5", "six": "6"}[data.topic]
- if (debug) console.debug(data.topic)
- if (debug) console.debug(data.also)
- //webview.runJavaScript("return lon('" + lon + "')")
- //webview.runJavaScript("return lat('" + lat + "')")
- //webview.runJavaScript("return action('three')")
- //webview.runJavaScript("return latlon('" + lat + "," +lon + "')")
+ if ( data.topic != lon ) {
+ webview.runJavaScript("return latlon('" + lat + "','" + lon + "')");
+ if (debug) console.debug(data.topic)
+ if (debug) console.debug(data.also)
+ }
break
}
}
|