Porównaj commity

...

65 Commity
v1.0.5 ... main

Autor SHA1 Wiadomość Data
Hans P. Reiser 066e455ab6 typo-- 2022-10-02 23:40:17 +00:00
Hans P. Reiser 8debacde53 travis test 2022-10-02 23:35:48 +00:00
Hans P. Reiser 3d44b7f0e3 fix 1.0.7 2022-10-02 23:26:08 +00:00
Hans P. Reiser 5b863f7a1a url update for prediction 2022-10-02 23:08:31 +00:00
Hans P. Reiser 3e23aa56b5 travis testing for macos 2022-05-26 10:40:33 +00:00
Hans P. Reiser c22720f132 Merge branch 'upa' 2022-05-19 17:18:28 +00:00
Hansi, dl9rdz 6a3af0ad76 test 2022-05-19 19:11:33 +02:00
Hans P. Reiser a63a742e39 some build system verison updates 2022-05-19 00:17:54 +00:00
Hansi, dl9rdz 0fe5f00751 fix prediction for longituade < 0 (tawhiri api uses 0..360) 2021-06-26 12:28:58 +02:00
Hansi, dl9rdz b3808f8e26 electron win testing 2021-06-18 20:28:20 +02:00
Hansi, dl9rdz 1e02a92714 electron win testing 2021-06-18 20:22:28 +02:00
Hansi, dl9rdz 1d54b2e4dc electron win testing 2021-06-18 19:36:51 +02:00
Hansi, dl9rdz 9ab62faf25 electron win testing 2021-06-18 19:22:56 +02:00
Hansi, dl9rdz 17d679bbd8 more travis testing 2021-06-16 22:52:12 +02:00
Hansi, dl9rdz 201c4f412a more travis testing: win 2021-06-16 18:54:29 +02:00
Hansi, dl9rdz fe7977bcd5 more travis testing: win 2021-06-16 18:19:18 +02:00
Hansi, dl9rdz 92e64c1cbc more travis testing: win 2021-06-16 18:06:51 +02:00
Hansi, dl9rdz b369d7c8d4 more travis testing: win 2021-06-16 17:46:07 +02:00
Hansi, dl9rdz 8fb2461c0c more travis testing: win 2021-06-16 17:02:23 +02:00
Hansi, dl9rdz f5f41fc192 more travis testing: win 2021-06-16 16:58:01 +02:00
Hansi, dl9rdz be6d7d5208 more travis testing: win 2021-06-16 16:35:04 +02:00
Hansi, dl9rdz f7d0b306dc more travis testing: win 2021-06-16 16:30:42 +02:00
Hansi, dl9rdz 3c3154a57b more travis testing 2021-06-16 16:08:40 +02:00
Hansi, dl9rdz 604f2f14ac more travis testing 2021-06-16 16:01:27 +02:00
Hansi, dl9rdz 6a733ce6d6 more travis testing 2021-06-16 15:01:40 +02:00
Hansi, dl9rdz e955bec659 missing change for update check 2021-06-16 13:55:37 +02:00
Hansi, dl9rdz 8e3d1d9fd8 more travis testing 2021-06-16 09:27:39 +02:00
Hansi, dl9rdz e39a936336 more travis testing 2021-06-16 09:09:33 +02:00
Hansi, dl9rdz fe26ec60c2 more travis testing 2021-06-16 08:11:04 +02:00
Hansi, dl9rdz 3152941df9 more travis testing 2021-06-16 08:02:33 +02:00
Hansi, dl9rdz 398dad6f8e more travis testing 2021-06-15 23:56:01 +02:00
Hansi, dl9rdz 7ecff3f7e7 more travis testing 2021-06-15 23:45:00 +02:00
Hansi, dl9rdz c1fbd05ee1 more travis testing 2021-06-15 23:37:44 +02:00
Hansi, dl9rdz c998771c05 more travis testing 2021-06-15 23:16:21 +02:00
Hansi, dl9rdz 963cebeeb2 more travis testing 2021-06-15 23:06:57 +02:00
Hansi, dl9rdz 85f23a3082 more travis testing 2021-06-15 22:58:59 +02:00
Hansi, dl9rdz d549cbc836 set JAVA_HOM 2021-06-15 21:35:32 +02:00
Hansi, dl9rdz 4ee76661f2 dep fix 2021-06-15 21:28:56 +02:00
Hansi, dl9rdz 00c1113cdf added missing icon 2021-06-15 21:05:30 +02:00
Hansi, dl9rdz f2241dae35 travis test 2021-06-15 21:01:55 +02:00
Hansi, dl9rdz 1642bcd8d6 travis test 2021-06-15 20:56:51 +02:00
Hansi, dl9rdz e0969103e6 travis test 2021-06-15 20:50:18 +02:00
Hansi, dl9rdz 3fc7d4bced travis test 2021-06-15 20:45:18 +02:00
Hansi, dl9rdz 192a8e6df7 travis test 2021-06-15 20:42:22 +02:00
Hansi, dl9rdz 7e4c06018b travis test 2021-06-15 20:36:40 +02:00
Hansi, dl9rdz 81cb6471d2 travis test 2021-06-15 20:29:43 +02:00
Hansi, dl9rdz 69e96cd166 travis test 2021-06-15 20:25:09 +02:00
Hansi, dl9rdz 3f4849389c travis test 2021-06-15 20:18:51 +02:00
Hansi, dl9rdz 5624735548 travis test 2021-05-29 23:17:14 +02:00
Hansi, dl9rdz 802e6662ea travis test 2021-05-29 23:11:12 +02:00
Hansi, dl9rdz e57e69786a travis test 2021-05-29 23:03:29 +02:00
Hansi, dl9rdz 783716bf55 travis test 2021-05-29 23:01:22 +02:00
Hansi, dl9rdz 231412810e travis test 2021-05-29 22:53:11 +02:00
Hansi, dl9rdz e4a3936c51 travis test 2021-05-29 22:45:45 +02:00
Hansi, dl9rdz b17d83c1a7 travis test 2021-05-29 22:26:03 +02:00
Hansi, dl9rdz 2ed799ac31 travis test 2021-05-29 22:16:19 +02:00
Hansi, dl9rdz 71476626f7 travis test 2021-05-29 22:11:41 +02:00
Hansi, dl9rdz d5ee287f9a travis test 2021-05-29 22:08:48 +02:00
Hansi, dl9rdz 02bfc0ee8c travis test 2021-05-29 22:04:04 +02:00
Hansi, dl9rdz 9f0d3b7220 travis test 2021-05-29 22:00:13 +02:00
Hansi, dl9rdz c714769ee1 travis test 2021-05-29 18:23:06 +02:00
Hansi, dl9rdz d1b1e74bd4 travis test 2021-05-29 18:14:49 +02:00
Hansi, dl9rdz 17a4e44203 version boost, travis test 2021-05-29 18:07:48 +02:00
Hansi, dl9rdz 7531b4be0a +travis test 2021-05-29 17:50:41 +02:00
Hansi, dl9rdz 233fd21ec5 bug-- 2021-02-15 14:54:42 +01:00
13 zmienionych plików z 333 dodań i 36 usunięć

119
.travis.yml 100644
Wyświetl plik

@ -0,0 +1,119 @@
matrix:
include:
- os: osx
osx_image: xcode11.3
language: node_js
node_js: "18"
env:
- ELECTRON_CACHE=$HOME/.cache/electron
- ELECTRON_BUILD_BACHE=$HOME/.cache/electron-builder
deploy:
provider: releases
api_key: ${GITHUB_API_KEY}
file: rdzSonde-v${TRAVIS_TAG}.dmg
skip_cleanup: true
overwrite: true
on:
tags: true
# - os: windows
# language: node_js
# node_js: "12"
# env:
# - ELECTRON_CACHE=$HOME/.cache/electron
# - ELECTRON_BUILD_BACHE=$HOME/.cache/electron-builder
# deploy:
# provider: releases
# api_key: ${GITHUB_API_KEY}
# file: rdzSonde-setup-${TRAVIS_TAG}.exe
# skip_cleanup: true
# overwrite: true
# on:
# tags: true
# - os: linux
# language: minimal
# dist: focal
# group: edge
# deploy:
# provider: releases
# api_key: ${GITHUB_API_KEY}
# file: rdzSonde-${TRAVIS_TAG}.apk
# skip_cleanup: true
# overwrite: true
# on:
# tags: true
#
env:
global:
# for updates check developer.android.com/studio#downloads (current 26.1.1)
- ANDROID_SDK_TOOLS=commandlinetools-linux-7302050_latest.zip
- JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
cache:
directories:
- mode_modules
- $HOME/.cache/electron
- $HOME/.cache/electron-builder
before_script:
#- echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a
# - emulator -avd test -no-audio -no-window &
# - android-wait-for-emulator
# - adb shell input keyevent 82 &
# - curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then
npm install -g cordova;
cordova platform add electron;
fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
sudo npm install -g cordova;
cordova platform add electron;
fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
echo ${TEST};
sudo apt-get update;
sudo apt-get install nodejs;
sudo apt-get install npm;
sudo apt-get install openjdk-11-jdk;
sudo apt-get install gradle;
wget -nv https://dl.google.com/android/repository/$ANDROID_SDK_TOOLS;
unzip -q $ANDROID_SDK_TOOLS -d $HOME/sdk;
mv $HOME/sdk/cmdline-tools $HOME/sdk/latest;
mkdir $HOME/sdk/cmdline-tools;
mv $HOME/sdk/latest $HOME/sdk/cmdline-tools/;
export PATH=$PATH:$HOME/sdk/cmdline-tools/latest/bin;
export ANDROID_SDK_ROOT=$HOME/sdk;
yes | sdkmanager --sdk_root=$ANDROID_SDK_ROOT "platforms;android-29";
yes | sdkmanager --sdk_root=$ANDROID_SDK_ROOT "emulator" "tools" "platform-tools";
yes | sdkmanager --sdk_root=$ANDROID_SDK_ROOT --licenses;
yes | sdkmanager --sdk_root=$ANDROID_SDK_ROOT "build-tools;29.0.3";
sudo npm install -g cordova;
sudo chown -R 2000:2000 "/home/travis/.npm";
cordova platform add android;
perl -pi -e 's/1\.8\.x/11.x/' ./platforms/android/cordova/lib/check_reqs.js;
fi
script:
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then
echo "Windows";
cordova build electron --debug;
find platforms;
mv platforms/electron/build/*.exe rdzSonde-setup-${TRAVIS_TAG}.exe;
ls *.exe;
fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
echo "OSX";
cordova build electron --release;
mv platforms/electron/build/rdzSonde*.dmg rdzSonde-v${TRAVIS_TAG}.dmg;
fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
cordova build --release;
export BUILD_TOOLS=$HOME/sdk/build-tools/29.0.3;
${BUILD_TOOLS}/zipalign -v -p 4 platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk rdzSonde-unsigned.apk;
echo ${SUPERSECRET} | gpg --batch --yes --passphrase-fd 0 -d my-release-key.jks.gpg > my-release-key.jks;
echo ${JKSPASS} | ${BUILD_TOOLS}/apksigner sign --ks my-release-key.jks --out rdzSonde-${TRAVIS_TAG}.apk rdzSonde-unsigned.apk;
fi

37
Makefile 100644
Wyświetl plik

@ -0,0 +1,37 @@
export ANDROID_SDK_ROOT=/Users/hansr/Library/Android/sdk
all: run
el: plugin
cordova build electron
run:
clear
cp ../rdzwx-plugin/src/android/*.kt ./platforms/android/app/src/main/kotlin/de/dl9rdz/
cordova run android --device
full:
clear
cordova plugin rm de-dl9rdz-rdzwx
cordova plugin add ../rdzwx-plugin/
cordova run android --device
plugin:
cordova plugin rm de-dl9rdz-rdzwx
cordova plugin add ../rdzwx-plugin/
release: apkrelease sign
mkrelease:
cordova build --release
.ONESHELL:
sign:
cd platforms/android/app/build/outputs/apk/release/ && \
rm -f app-release-unsigned-aligned.apk && \
/Users/hansr/Library/Android//sdk/build-tools/30.0.3/zipalign -v -p 4 app-release-unsigned.apk app-release-unsigned-aligned.apk && \
/Users/hansr/Library/Android//sdk/build-tools/30.0.3/apksigner sign --ks ~/src/rdzwx-go/my-release-key.jks --out app-release.apk app-release-unsigned-aligned.apk
apkrelease:
cordova build --release -- --packageType=apk

Wyświetl plik

@ -6,22 +6,29 @@ See https://github.com/dl9rdz/rdzwx-go/wiki for details how to use.
## How to compile and run
- Install Android Studio
- Install Java (I used openjdk 11, gradle and android on API level 30 do not support later openjdk version) and gradle (I used version 7.4.2) (I installed both on MacOS with brew)
- Install Android Studio (currently tested with Chipmunk 2021.2.1)
In Preferences: Appearance&Behaviour > System Settings > Android SDK
SDK Platforms: select some relevant platform (I used API level 29)
SDK Platforms: select some relevant platform (I used API level 32)
SDK Tools: I selected Build-Tools, NDK, SDK command line, emulator, SDKK platform tools (maybe not all necessary)
SDK Tools: I selected Build-Tools, NDK, SDK command line, emulator, SKK platform tools (maybe not all necessary)
Specifically, build tools 30.0.3 are needed!!!
- `export ANDROID_SDK_ROOT=/Users/me/Library/Android/sdk`
Use path shown in Android Studio preferences as "Android SDK Location"!
- Install node.js (after that you should be able to run "node" and "npm" on your command line)
(On MacOS I did 'brew install nodejs')
- Install Cordova (used version 9.0.0): `sudo npm install -g cordova`
- clone the git repository (`git clone https://github.com/dl9rdz/rdzwx-go.git`)
- `cd rdzwx-go; cordova platform add android`
- cordova plugin add cordova-plugin-androidx-adapter
- npm i jetifier
- npx jetifier
- `cordova build` to build debug apk
- `cordova build --release` to build releaes apk
- `cordova run android` to upload apk via usb to phone

Wyświetl plik

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="de.dl9rdz" version="1.0.5" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"
<widget id="de.dl9rdz" version="1.0.7" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"
xmlns:android="schemas.android.com/apk/res/android">
<name>rdzSondyGO</name>
<name>rdzSonde</name>
<description>
A sample Apache Cordova application that uses rdzwx-plugin.
</description>
@ -29,15 +29,20 @@
<application android:usesCleartextTraffic="true" />
</edit-config>
</platform>
<icon src="res/icon.png"/>
<icon src="res/icon512.png"/>
<platform name="electron">
<preference name="ElectronSettingsFilePath" value="res/electron/settings.json" />
</platform>
<preference name="GradlePluginKotlinEnabled" value="true" />
<preference name="GradlePluginKotlinCodeStyle" value="official" />
<preference name="GradlePluginKotlinVersion" value="1.3.50" />
<preference name="android-minSdkVersion" value="23" />
<preference name="android-targetSdkVersion" value="29" />
<preference name="android-targetSdkVersion" value="30" />
<preference name="SplashScreen" value="none" />
<preference name="AndroidInsecureFileModeEnabled" value="true" />
</widget>

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -1,7 +1,7 @@
{
"name": "de.dl9rdz",
"displayName": "rdzwx-go",
"version": "1.0.5",
"version": "1.0.7",
"description": "A sample Apache Cordova application that uses rdzwx-plugin.",
"main": "index.js",
"scripts": {
@ -12,26 +12,41 @@
],
"author": "Hansi Reiser <dl9rdz@darc.de>",
"license": "Apache-2.0",
"overrides": {
"electron-builder": "23.0.3"
},
"dependencies": {
"jetifier": "^2.0.0",
"net": "^1.0.2",
"update": "^0.7.4",
"xmlhttprequest": "^1.8.0"
},
"devDependencies": {
"cordova-android": "^9.0.0",
"cordova-android": "^10.1.2",
"cordova-browser": "^6.0.0",
"cordova-plugin-badge": "^0.8.8",
"cordova-plugin-device": "^2.0.3",
"cordova-plugin-inappbrowser": "^4.1.0",
"cordova-plugin-local-notification": "^0.9.0-beta.2",
"cordova-plugin-whitelist": "^1.3.4",
"de-dl9rdz-rdzwx": "https://github.com/dl9rdz/rdzwx-plugin.git"
"cordova-electron": "^3.0.0",
"cordova-plugin-androidx-adapter": "^1.1.3",
"cordova-plugin-inappbrowser": "^5.0.0",
"rdzwx-plugin": "github:dl9rdz/rdzwx-plugin"
},
"cordova": {
"plugins": {
"cordova-plugin-whitelist": {},
"cordova-plugin-androidx-adapter": {},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-local-notification": {},
"de-dl9rdz-rdzwx": {}
},
"platforms": [
"android",
"browser"
"browser",
"electron"
]
},
"browser": {
"net": false,
"fs": false
},
"electron": {
"net": false,
"fs": false
}
}

Wyświetl plik

@ -0,0 +1,10 @@
{
"browserWindow": {
"width": 1200,
"height": 800,
"webPreferences": {
"nodeIntegration": true,
"contextIsolation": false
}
}
}

BIN
res/icon512.png 100644

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 64 KiB

Wyświetl plik

@ -1,5 +1,5 @@
{
"version": "1.0.5",
"url": "https://github.com/dl9rdz/rdzwx-go/releases/tag/v1.0.4",
"apkurl": "https://github.com/dl9rdz/rdzwx-go/releases/download/v1.0.4/rdzSondyGO-v1.0.4.apk"
"version": "1.0.7",
"url": "https://github.com/dl9rdz/rdzwx-go/releases/tag/v1.0.7",
"apkurl": "https://github.com/dl9rdz/rdzwx-go/releases/download/v1.0.7/rdzSonde-v1.0.7.apk"
}

Wyświetl plik

@ -127,6 +127,8 @@ html, body {
font-size: 11pt;
}
.tawhiricontent input {
color: #ffffff;
background-color: #000000;
font-size: 11pt;
width: 5em;
}

Wyświetl plik

@ -33,7 +33,7 @@
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="initial-scale=1, width=device-width, viewport-fit=cover, user-scalable=no">
<meta name="color-scheme" content="light dark">
<meta name="color-scheme" content="light">
<link rel="stylesheet" href="css/leaflet.css">
<link rel="stylesheet" href="css/leaflet.contextmenu.css">
<link rel="stylesheet" href="css/index.css">
@ -48,22 +48,29 @@
<script src="js/easy-button.js"></script>
<script src="js/L.Control.MousePosition.js"></script>
<title>rdzSondyGO V1.0.5</title>
<title>rdzSonde v1.0.7 +experimental</title>
</head>
<body>
<div id="all">
<div id="toolbar">
<a id="toolbarclose" class="leaflet-popup-close-button" style="cursor: pointer; float: right;">X</a>
<h2>rdzSondyGO v1.0.5</h2>
<p>Copyright &copy; 2021 Hansi Reiser, dl9rdz</p>
<h2>rdzSonde v1.0.7 +experimental</h2>
<p>Copyright &copy; 2022 Hansi Reiser, dl9rdz</p>
<p>see <a href="https://github.com/dl9rdz/rdzwx-go">https://github.com/dl9rdz/rdzwx-go</a> for details</p>
<p>Apache License Version 2.0</p>
<hr>
<button onclick="RdzWx.selstorage(&quot;map&quot;, function(res) { localStorage.setItem(&quot;mapstorage&quot;, res); })">Select map file </button>
<hr>
<button onclick="RdzWx.selstorage(&quot;theme&quot;, function(res) { localStorage.setItem(&quot;mapstorage&quot;, res); })">Select map theme </button>
<hr>
<div id="toolbaritems">
</div>
</div>
<div id='map'></div>
</div>
<script>
if(typeof(global)=='undefined') { global = globalThis; }
</script>
<script src="js/index.js"></script>
</body>
</html>

Wyświetl plik

@ -38,6 +38,10 @@ var infobox = null;
var checkMark = "&#x2714;";
var crossMark = "&#x274C;";
var offlineMap = localStorage.getItem("mapstorage");
if(!offlineMap) offlineMap="file:///sdcard/Android/data/de.dl9rdz.files/";
console.log("Map storage location: "+offlineMap);
// add "top center" and "bottom center" to leaflet
(function (L) {
L.Map.prototype._initControlPos = function(_initControlPos) {
@ -81,7 +85,7 @@ function onDeviceReady() {
.then(response => response.json())
.then(data => {
console.log('Success:', data);
if(data.version > "1.0.5") {
if(data.version > "1.0.7") {
if(window.confirm("New version "+ data.version + " available! Download?")) {
console.log("opening "+data.url);
cordova.InAppBrowser.open(data.url, "_system");
@ -100,8 +104,76 @@ function onDeviceReady() {
tfcycle = L.tileLayer('https://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=' + tfapikey, {attribution: '&copy; <a href="http://www.thunderforest.com/">Thunderforest</a>, &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}),
tfatlas = L.tileLayer('https://{s}.tile.thunderforest.com/mobile-atlas/{z}/{x}/{y}.png?apikey=' + tfapikey, {attribution: '&copy; <a href="http://www.thunderforest.com/">Thunderforest</a>, &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}),
opentopo = L.tileLayer('https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', {attribution: 'Kartendaten: &copy; <a href="https://openstreetmap.org/copyright">OpenStreetMap</a>-Mitwirkende, <a href="http://viewfinderpanoramas.org">SRTM</a> | Kartendarstellung: &copy; <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)'}),
sat = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', { attribution: 'Tiles &copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'}),
offline = L.tileLayer('file:///android_asset/www/tiles/{z}/{x}/{y}.png', {attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>', maxNativeZoom: 14} );
sat = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', { attribution: 'Tiles &copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'})
L.OfflineTileLayer = L.TileLayer.extend({
getTileUrl: function(tilePoint, tile, done) {
var tilesrc;
var z = tilePoint.z, x = tilePoint.x, y = tilePoint.y;
console.log("Coord: "+x+","+y+","+z);
console.log("this: " + this);
tile.thethis = this;
RdzWx.gettile(x, y, z, function(result) {
if(result.tile) {
console.log("gettile: success: " + result.tile);
tile.onload = L.Util.bind(tile.thethis._tileOnLoad, this, done, tile);
tile.src = result.tile;
//done(tile);
} else {
console.log("gettile: success but no tile");
tile.src = "img/MapTileUnavailable.png";
done(tile);
}
}, function(error) {
console.log("gettile: error: " + error);
tile.src = "img/MapTileUnavailable.png";
done(tile);
});
console.log("getTileUrl returning...");
//return tilestr;
},
createTile: function (coords, done) {
var tile = document.createElement('img');
//DomEvent.on(tile, 'load', Util.bind(this._tileOnLoad, this, done, tile));
//DomEvent.on(tile, 'error', Util.bind(this._tileOnError, this, done, tile));
if (this.options.crossOrigin || this.options.crossOrigin === '') {
tile.crossOrigin = this.options.crossOrigin === true ? '' : this.options.crossOrigin;
}
/*
Alt tag is set to empty string to keep screen readers from reading URL and for compliance reasons
http://www.w3.org/TR/WCAG20-TECHS/H67
*/
tile.alt = '';
/*
Set role="presentation" to force screen readers to ignore this
https://www.w3.org/TR/wai-aria/roles#textalternativecomputation
*/
tile.setAttribute('role', 'presentation');
//tile.src = this.getTileUrl(coords);
this.getTileUrl(coords, tile, done);
return tile;
}
/*
_loadTile: function(tile, tilePoint) {
tile._layer = this;
tile.onload = this._tileOnLoad;
tile.onerror = this._tileOnError;
this._adjustTilePoint(tilePoint);
this.getTileURL(tilePoint, tile);
this.fire("tileloadstart", { tile: tile, url: tile.src } );
},
*/
});
L.offlineTileLayer = function(url, options) {
return new L.OfflineTileLayer(url, options);
};
var offline = L.offlineTileLayer("http://NOWHERE", {attribution: 'Map data &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors', maxZoom: 22});
Stamen_TonerHybrid = L.tileLayer('https://stamen-tiles-{s}.a.ssl.fastly.net/toner-hybrid/{z}/{x}/{y}{r}.{ext}', {
attribution: 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> &mdash; Map data &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
subdomains: 'abcd',
@ -117,6 +189,7 @@ function onDeviceReady() {
map = L.map('map', { layers: [osm], contextmenu: true, zoomControl: false} ).setView([48,13],12);
var baseMaps = {
'Offline': offline,
"Openstreetmap": osm,
"Landscape": tfland,
"Transport": tftrans,
@ -126,7 +199,6 @@ function onDeviceReady() {
"OpenTopoMap" : opentopo,
"Sat": sat,
"Sat/Hybrid": hybrid
<!-- 'Offline': offline -->
};
var baseMapControl = new L.control.layers(baseMaps, {}, { collapsed: true, position: 'topright' } ).addTo(map);
@ -345,7 +417,7 @@ function onDeviceReady() {
if(obj.hdop<0) { // GPS fix lost
} else {
var p0 = L.latLng(obj);
var p1 = L.latLng(_currentObj);
var p1 = L.latLng(this._currentObj);
var b = p0.bearingTo(p1);
var d = p0.distanceTo(p1);
this._icd = b;
@ -536,7 +608,8 @@ function removePrediction(marker) {
}
function getPrediction(refobj) {
TAWHIRI = 'http://predict.cusf.co.uk/api/v1';
// going out of service soon... TAWHIRI = 'http://predict.cusf.co.uk/api/v1';
TAWHIRI = 'https://api.v2.sondehub.org/tawhiri';
if(refobj == null) { refobj = lastMarker; }
if(refobj == null) {
alert("no object available");
@ -551,10 +624,12 @@ function getPrediction(refobj) {
var desc = document.getElementById("tawhiri-descent").value;
if(desc) desc=parseFloat(desc); else desc=5.0;
var usecurrent = document.getElementById("tawhiri-current").checked;
var lon = refobj.obj.lon;
if(lon<0) lon+=360; // tawhiri api needs 0..360
var tParams = {
"launch_latitude": refobj.obj.lat,
"launch_longitude": refobj.obj.lon,
"launch_longitude": lon,
"launch_altitude": refobj.obj.alt.toFixed(1),
"launch_datetime": new Date().toISOString().split('.')[0] + 'Z',
"ascent_rate": asc,
@ -586,8 +661,8 @@ function getPrediction(refobj) {
var traj0 = pred.prediction[0].trajectory; // 0 is ascent, 1 is descent...
var traj1 = pred.prediction[1].trajectory; // 0 is ascent, 1 is descent...
var latlons = [];
traj0.forEach( p => latlons.push( [p.latitude, p.longitude] ) );
traj1.forEach( p => latlons.push( [p.latitude, p.longitude] ) );
traj0.forEach( p => latlons.push( [p.latitude, wrap(p.longitude)] ) );
traj1.forEach( p => latlons.push( [p.latitude, wrap(p.longitude)] ) );
//alert("path: "+JSON.stringify(traj));
poly = L.polyline(latlons, { opacity: 0.7, color: '#EE0000', dashArray: '8, 6'} );
poly.addTo(map);
@ -641,6 +716,8 @@ function callBack(arg) {
return;
}
update(obj);
// for now, only for electron (does not support keepCallback)
//RdzWx.next(callBack);
}
function updateMypos(obj) {
@ -674,8 +751,6 @@ function updateMypos(obj) {
}
}
var lastMsgTS = 0;
function periodicStatusCheck() {
now = new Date();
if( lastMsgTS && (now-lastMsgTS) > 10000 ) {
@ -831,3 +906,20 @@ function createButton(label, container) {
btn.innerHTML = label;
return btn;
}
function wrap(lng) {
if(lng>180) { return lng-360; }
return lng;
}
// radiosondy.info
function reqauth() {
var xhr = new XMLHttpRequest();
xhr.open("POST", "https://radiosondy.info/user/login.php?", true);
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xhr.onreadystatechange = function() {
if(http.readyState == 4 && http.satus == 200) {
alert(http.resonseText);
}
}
xhr.send('submitted=1&username=DL9RDZ&password=ct1jzmhr&Submit=Login');
}

Wyświetl plik

@ -11,10 +11,13 @@
if (typeof define === 'function' && define.amd) {
// AMD
define(['leaflet'], factory);
/*
// not working well with Cordova/electron
} else if (typeof module === 'object' && typeof module.exports === 'object') {
// Node/CommonJS
L = require('leaflet');
module.exports = factory(L);
*/
} else {
// Browser globals
if (typeof window.L === 'undefined') {