kopia lustrzana https://github.com/dl9rdz/rdzwx-go
Porównaj commity
65 Commity
Autor | SHA1 | Data |
---|---|---|
Hans P. Reiser | 066e455ab6 | |
Hans P. Reiser | 8debacde53 | |
Hans P. Reiser | 3d44b7f0e3 | |
Hans P. Reiser | 5b863f7a1a | |
Hans P. Reiser | 3e23aa56b5 | |
Hans P. Reiser | c22720f132 | |
Hansi, dl9rdz | 6a3af0ad76 | |
Hans P. Reiser | a63a742e39 | |
Hansi, dl9rdz | 0fe5f00751 | |
Hansi, dl9rdz | b3808f8e26 | |
Hansi, dl9rdz | 1e02a92714 | |
Hansi, dl9rdz | 1d54b2e4dc | |
Hansi, dl9rdz | 9ab62faf25 | |
Hansi, dl9rdz | 17d679bbd8 | |
Hansi, dl9rdz | 201c4f412a | |
Hansi, dl9rdz | fe7977bcd5 | |
Hansi, dl9rdz | 92e64c1cbc | |
Hansi, dl9rdz | b369d7c8d4 | |
Hansi, dl9rdz | 8fb2461c0c | |
Hansi, dl9rdz | f5f41fc192 | |
Hansi, dl9rdz | be6d7d5208 | |
Hansi, dl9rdz | f7d0b306dc | |
Hansi, dl9rdz | 3c3154a57b | |
Hansi, dl9rdz | 604f2f14ac | |
Hansi, dl9rdz | 6a733ce6d6 | |
Hansi, dl9rdz | e955bec659 | |
Hansi, dl9rdz | 8e3d1d9fd8 | |
Hansi, dl9rdz | e39a936336 | |
Hansi, dl9rdz | fe26ec60c2 | |
Hansi, dl9rdz | 3152941df9 | |
Hansi, dl9rdz | 398dad6f8e | |
Hansi, dl9rdz | 7ecff3f7e7 | |
Hansi, dl9rdz | c1fbd05ee1 | |
Hansi, dl9rdz | c998771c05 | |
Hansi, dl9rdz | 963cebeeb2 | |
Hansi, dl9rdz | 85f23a3082 | |
Hansi, dl9rdz | d549cbc836 | |
Hansi, dl9rdz | 4ee76661f2 | |
Hansi, dl9rdz | 00c1113cdf | |
Hansi, dl9rdz | f2241dae35 | |
Hansi, dl9rdz | 1642bcd8d6 | |
Hansi, dl9rdz | e0969103e6 | |
Hansi, dl9rdz | 3fc7d4bced | |
Hansi, dl9rdz | 192a8e6df7 | |
Hansi, dl9rdz | 7e4c06018b | |
Hansi, dl9rdz | 81cb6471d2 | |
Hansi, dl9rdz | 69e96cd166 | |
Hansi, dl9rdz | 3f4849389c | |
Hansi, dl9rdz | 5624735548 | |
Hansi, dl9rdz | 802e6662ea | |
Hansi, dl9rdz | e57e69786a | |
Hansi, dl9rdz | 783716bf55 | |
Hansi, dl9rdz | 231412810e | |
Hansi, dl9rdz | e4a3936c51 | |
Hansi, dl9rdz | b17d83c1a7 | |
Hansi, dl9rdz | 2ed799ac31 | |
Hansi, dl9rdz | 71476626f7 | |
Hansi, dl9rdz | d5ee287f9a | |
Hansi, dl9rdz | 02bfc0ee8c | |
Hansi, dl9rdz | 9f0d3b7220 | |
Hansi, dl9rdz | c714769ee1 | |
Hansi, dl9rdz | d1b1e74bd4 | |
Hansi, dl9rdz | 17a4e44203 | |
Hansi, dl9rdz | 7531b4be0a | |
Hansi, dl9rdz | 233fd21ec5 |
|
@ -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
|
||||
|
||||
|
|
@ -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
|
||||
|
13
README.md
13
README.md
|
@ -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
|
||||
|
|
13
config.xml
13
config.xml
|
@ -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.
37
package.json
37
package.json
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"browserWindow": {
|
||||
"width": 1200,
|
||||
"height": 800,
|
||||
"webPreferences": {
|
||||
"nodeIntegration": true,
|
||||
"contextIsolation": false
|
||||
}
|
||||
}
|
||||
}
|
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 64 KiB |
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -127,6 +127,8 @@ html, body {
|
|||
font-size: 11pt;
|
||||
}
|
||||
.tawhiricontent input {
|
||||
color: #ffffff;
|
||||
background-color: #000000;
|
||||
font-size: 11pt;
|
||||
width: 5em;
|
||||
}
|
||||
|
|
|
@ -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 © 2021 Hansi Reiser, dl9rdz</p>
|
||||
<h2>rdzSonde v1.0.7 +experimental</h2>
|
||||
<p>Copyright © 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("map", function(res) { localStorage.setItem("mapstorage", res); })">Select map file </button>
|
||||
<hr>
|
||||
<button onclick="RdzWx.selstorage("theme", function(res) { localStorage.setItem("mapstorage", 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>
|
||||
|
|
114
www/js/index.js
114
www/js/index.js
|
@ -38,6 +38,10 @@ var infobox = null;
|
|||
var checkMark = "✔";
|
||||
var crossMark = "❌";
|
||||
|
||||
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: '© <a href="http://www.thunderforest.com/">Thunderforest</a>, © <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: '© <a href="http://www.thunderforest.com/">Thunderforest</a>, © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}),
|
||||
opentopo = L.tileLayer('https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', {attribution: 'Kartendaten: © <a href="https://openstreetmap.org/copyright">OpenStreetMap</a>-Mitwirkende, <a href="http://viewfinderpanoramas.org">SRTM</a> | Kartendarstellung: © <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 © Esri — 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: '© <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 © Esri — 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 © <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> — Map data © <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');
|
||||
}
|
||||
|
|
|
@ -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') {
|
||||
|
|
Ładowanie…
Reference in New Issue