forked from FOSS/BangleApps
parent
e52e89f204
commit
3995df7fdb
|
@ -74,4 +74,6 @@
|
|||
* Avoid angles flickering at low speed at the cost of less refresh.
|
||||
* Splash screen while waiting for gps signal.
|
||||
|
||||
0.17: Convert Yes/No On/Off in settings to checkboxes
|
||||
0.17:
|
||||
* Major rewrite of display : now tile based
|
||||
* We have a map. Never get lost again.
|
||||
|
|
|
@ -16,6 +16,7 @@ This software is not perfect but surprisingly useful.
|
|||
It provides the following features :
|
||||
|
||||
- display the path with current position from gps
|
||||
- display a local map around you, downloaded from openstreetmap
|
||||
- detects and buzzes if you leave the path
|
||||
- buzzes before sharp turns
|
||||
- buzzes before waypoints
|
||||
|
@ -28,17 +29,14 @@ It provides the following features :
|
|||
- artwork
|
||||
- bakeries
|
||||
|
||||
optionally it can also:
|
||||
|
||||
- try to turn off gps between crossroads to save battery
|
||||
|
||||
## Usage
|
||||
|
||||
### Preparing the file
|
||||
|
||||
You first need to have a trace file in *gpx* format.
|
||||
Usually I download from [komoot](https://www.komoot.com/) or I export
|
||||
from google maps using [mapstogpx](https://mapstogpx.com/).
|
||||
from google maps using [mapstogpx](https://mapstogpx.com/). [Brouter](https://brouter.damsy.net) is
|
||||
also a nice open source option.
|
||||
|
||||
Note that *mapstogpx* has a super nice feature in its advanced settings.
|
||||
You can turn on 'next turn info' and be warned by the watch when you need to turn.
|
||||
|
@ -58,16 +56,16 @@ Once you have a signal you will reach the main screen:
|
|||
|
||||

|
||||
|
||||
The screen is oriented so that the top of the image is in front of you.
|
||||
It will rotate as you turn.
|
||||
On your screen you can see:
|
||||
|
||||
- yourself (the big black dot)
|
||||
- the path (the top of the screen is in front of you)
|
||||
- on the path, current and next segments are red and other ones are black
|
||||
- the path (thick red line)
|
||||
- a green arrow telling you which way is forward
|
||||
- if needed a projection of yourself on the path (small black dot)
|
||||
- points as white dots
|
||||
- waypoints as doubled white dots
|
||||
- waypoints as large white dots
|
||||
- some text on the left (from top to bottom):
|
||||
* time to reach start point at current average speed
|
||||
* current time
|
||||
* time to reach end point at current average speed
|
||||
* left distance till end of current segment
|
||||
|
@ -90,17 +88,18 @@ display the direction to follow as a black segment.
|
|||
Note that while lost, the app will slow down a lot since it will start scanning all possible points to figure out where you
|
||||
are. On path it just needed to scan a few points ahead and behind.
|
||||
|
||||

|
||||
|
||||
The distance to next point displayed corresponds to the length of the black segment.
|
||||
|
||||
### Menu
|
||||
|
||||
If you click the button you'll reach a menu where you can currently zoom out to see more of the map
|
||||
(with a slower refresh rate) and reverse the path direction.
|
||||
|
||||
### Settings
|
||||
|
||||
Few settings for now (feel free to suggest me more) :
|
||||
|
||||
- keep gps alive : if turned off, will try to save battery by turning the gps off on long segments
|
||||
- max speed : used to compute how long to turn the gps off
|
||||
- display points : display/hide points (not waypoints)
|
||||
- lost distance : at which distance from path are you considered to be lost ?
|
||||
|
||||
### Caveats
|
||||
|
||||
|
@ -109,8 +108,8 @@ It is good to use but you should know :
|
|||
- the gps might take a long time to start initially (see the assisted gps update app).
|
||||
- gps signal is noisy : there is therefore a small delay for instant speed. sometimes you may jump somewhere else.
|
||||
- your gpx trace has been decimated and approximated : the **REAL PATH** might be **A FEW METERS AWAY**
|
||||
- sometimes the watch will tell you that you are lost but you are in fact on the path.
|
||||
- battery saving by turning off gps is not very well tested (disabled by default).
|
||||
- sometimes the watch will tell you that you are lost but you are in fact on the path. It usually figures again
|
||||
the real gps position after a few minutes. It usually happens when the signal is acquired very fast.
|
||||
- buzzing does not always work: when there is a high load on the watch, the buzzes might just never happen :-(.
|
||||
- buzzes are not strong enough to be always easily noticed.
|
||||
- be careful when **GOING DOWNHILL AT VERY HIGH SPEED**. I already missed a few turning points and by the time I realized it,
|
||||
|
|
1230
apps/gipy/app.js
1230
apps/gipy/app.js
File diff suppressed because it is too large
Load Diff
|
@ -1,21 +1,27 @@
|
|||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="../../css/spectre.min.css">
|
||||
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.3/dist/leaflet.css"
|
||||
integrity="sha256-kLaT2GOSpHechhsozzB+flnD+zUyjE2LlfWPgU04xyI="
|
||||
crossorigin=""/>
|
||||
|
||||
<style>
|
||||
svg { width:95% }
|
||||
#svgmap { width: 95%; }
|
||||
#map { height: 180px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script src="https://unpkg.com/leaflet@1.9.3/dist/leaflet.js"
|
||||
integrity="sha256-WBkoXOwTeyKclOHuWtc+i2uENFpDZ9YPdf5Hf+D7ewM="
|
||||
crossorigin=""></script>
|
||||
<div id="map"></div>
|
||||
|
||||
<p>Please select a gpx file to be converted to gpc and loaded.</p>
|
||||
|
||||
<p>Please select a gpx file OR an area on the map using shift + drag the mouse.</p>
|
||||
|
||||
gpx file : <input type="file" is="gpx_file" id="fileInput" accept=".gpx">
|
||||
<br>
|
||||
gpc filename : <input type="text" id="gpc_file" name="gpc_file" maxlength="24">.gpc (max 24 characters)
|
||||
gps filename : <input type="text" id="gps_file" name="gps_file" maxlength="24">.gps (max 24 characters)
|
||||
<br>
|
||||
<input type="checkbox" id="osm" name="osm" checked>
|
||||
<label for="osm">fetch interests from openstreetmap</label>
|
||||
<table>
|
||||
<tr>
|
||||
<th><bold>OpenstreetMap <a href="https://wiki.openstreetmap.org/wiki/Tags">NODE Tags</a></bold></th>
|
||||
|
@ -46,7 +52,7 @@ svg { width:95% }
|
|||
|
||||
<input type="button" id="upload" name="upload" value="Upload" disabled>
|
||||
<div id="status"></div>
|
||||
<div id="map"></div>
|
||||
<div id="svgmap"></div>
|
||||
|
||||
<script src="../../core/lib/interface.js"></script>
|
||||
<script>
|
||||
|
@ -65,40 +71,82 @@ function vec_to_string(vec) {
|
|||
return final_string;
|
||||
}
|
||||
|
||||
import init, { convert_gpx_strings, convert_gpx_strings_no_osm, get_gpc, get_svg } from "./pkg/gpconv.js";
|
||||
function display_polygon(map) {
|
||||
document.getElementById('upload').disabled = true;
|
||||
if (displayed_polygon !== null) {
|
||||
displayed_polygon.remove();
|
||||
}
|
||||
let polygon = get_polygon(gps_data);
|
||||
let min_lat = polygon[0];
|
||||
let max_lat = polygon[0];
|
||||
let min_lng = polygon[1];
|
||||
let max_lng = polygon[1];
|
||||
let map_polygon = [];
|
||||
for (let i = 0 ; i < polygon.length ; i+=2) {
|
||||
map_polygon.push([polygon[i], polygon[i+1]]);
|
||||
if (min_lat > polygon[i]) {
|
||||
min_lat = polygon[i];
|
||||
} else if (max_lat < polygon[i]) {
|
||||
max_lat = polygon[i];
|
||||
}
|
||||
|
||||
if (min_lng > polygon[i+1]) {
|
||||
min_lng = polygon[i+1];
|
||||
} else if (max_lng < polygon[i+1]) {
|
||||
max_lng = polygon[i+1];
|
||||
}
|
||||
}
|
||||
displayed_polygon = L.polygon(map_polygon).addTo(map);
|
||||
map.fitBounds(L.latLngBounds(L.latLng(min_lat, min_lng), L.latLng(max_lat, max_lng)));
|
||||
document.getElementById('convert').disabled = false;
|
||||
}
|
||||
|
||||
import init, { load_gps_from_string, get_polygon, request_map, get_gps_content, get_gps_map_svg, gps_from_area } from "./pkg/gps.js";
|
||||
console.log("imported wasm");
|
||||
|
||||
let osm_checkbox = document.querySelector("input[name=osm]");
|
||||
let with_osm = true;
|
||||
// start map
|
||||
L.Map.BoxPrinter = L.Map.BoxZoom.extend({
|
||||
_onMouseUp: function (e) {
|
||||
|
||||
osm_checkbox.addEventListener('change', function() {
|
||||
if (this.checked) {
|
||||
with_osm = true;
|
||||
document.getElementById('key1').disabled = false;
|
||||
document.getElementById('key2').disabled = false;
|
||||
document.getElementById('key3').disabled = false;
|
||||
document.getElementById('key4').disabled = false;
|
||||
document.getElementById('value1').disabled = false;
|
||||
document.getElementById('value2').disabled = false;
|
||||
document.getElementById('value3').disabled = false;
|
||||
document.getElementById('value4').disabled = false;
|
||||
} else {
|
||||
with_osm = false;
|
||||
document.getElementById('key1').disabled = true;
|
||||
document.getElementById('key2').disabled = true;
|
||||
document.getElementById('key3').disabled = true;
|
||||
document.getElementById('key4').disabled = true;
|
||||
document.getElementById('value1').disabled = true;
|
||||
document.getElementById('value2').disabled = true;
|
||||
document.getElementById('value3').disabled = true;
|
||||
document.getElementById('value4').disabled = true;
|
||||
if ((e.which !== 1) && (e.button !== 1)) { return; }
|
||||
|
||||
this._finish();
|
||||
|
||||
if (!this._moved) { return; }
|
||||
// Postpone to next JS tick so internal click event handling
|
||||
// still see it as "moved".
|
||||
setTimeout(L.bind(this._resetState, this), 0);
|
||||
|
||||
var bounds = new L.LatLngBounds(
|
||||
this._map.containerPointToLatLng(this._startPoint),
|
||||
this._map.containerPointToLatLng(this._point));
|
||||
let south_west = bounds.getSouthWest();
|
||||
let north_east = bounds.getNorthEast();
|
||||
gps_data = gps_from_area(south_west.lng, south_west.lat, north_east.lng, north_east.lat);
|
||||
document.getElementById('gps_file').value = "";
|
||||
display_polygon(this._map);
|
||||
|
||||
this._map.fire('boxzoomend', {boxZoomBounds: bounds});
|
||||
}
|
||||
});
|
||||
});
|
||||
L.Map.mergeOptions({boxPrinter: true});
|
||||
L.Map.addInitHook('addHandler', 'boxPrinter', L.Map.BoxPrinter);
|
||||
|
||||
// now the interactions
|
||||
let status = document.getElementById("status");
|
||||
let gpx_content = null;
|
||||
let gpc_filename = null;
|
||||
let gpc_content = null;
|
||||
let gps_data = null;
|
||||
let gps_filename = null;
|
||||
let gps_content = null;
|
||||
let displayed_polygon = null;
|
||||
|
||||
init().then(() => {
|
||||
|
||||
var map = L.map('map').setView([45.1825, 5.6731], 1);
|
||||
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||
maxZoom: 19,
|
||||
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
|
||||
}).addTo(map);
|
||||
|
||||
|
||||
document
|
||||
.getElementById("fileInput")
|
||||
|
@ -112,10 +160,10 @@ document
|
|||
status.innerHTML = "reading file";
|
||||
|
||||
let gpx_filename = this.files[0].name;
|
||||
if (gpc_filename === null || gpc_filename == "") {
|
||||
if (gps_filename === null || gps_filename == "") {
|
||||
if (gpx_filename.length <= 28) {
|
||||
gpc_filename = gpx_filename.slice(0, gpx_filename.length - 4);
|
||||
document.getElementById('gpc_file').value = gpc_filename;
|
||||
gps_filename = gpx_filename.slice(0, gpx_filename.length - 4);
|
||||
document.getElementById('gps_file').value = gps_filename;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -123,8 +171,10 @@ document
|
|||
reader.onload = function fileReadCompleted() {
|
||||
console.log("reading file completed");
|
||||
status.innerHTML = "file reading completed";
|
||||
gpx_content = reader.result;
|
||||
document.getElementById('convert').disabled = false;
|
||||
let gpx_content = reader.result;
|
||||
|
||||
gps_data = load_gps_from_string(gpx_content);
|
||||
display_polygon(map);
|
||||
};
|
||||
reader.readAsText(this.files[0]);
|
||||
});
|
||||
|
@ -136,9 +186,6 @@ document
|
|||
document.getElementById('convert').disabled = true;
|
||||
document.getElementById('upload').disabled = true;
|
||||
status.innerHTML = "please wait, converting file";
|
||||
init().then(() => {
|
||||
let gpc_svg;
|
||||
if (with_osm) {
|
||||
let key1 = document.getElementById('key1').value;
|
||||
let key2 = document.getElementById('key2').value;
|
||||
let key3 = document.getElementById('key3').value;
|
||||
|
@ -147,32 +194,30 @@ document
|
|||
let value2 = document.getElementById('value2').value;
|
||||
let value3 = document.getElementById('value3').value;
|
||||
let value4 = document.getElementById('value4').value;
|
||||
gpc_svg = convert_gpx_strings(gpx_content, key1, value1, key2, value2, key3, value3, key4, value4);
|
||||
} else {
|
||||
gpc_svg = convert_gpx_strings_no_osm(gpx_content);
|
||||
}
|
||||
gpc_svg.then(gs => {
|
||||
request_map(gps_data, key1, value1, key2, value2, key3, value3, key4, value4).then(
|
||||
() => {
|
||||
|
||||
status.innerHTML = "file converted";
|
||||
let svg = get_svg(gs);
|
||||
let svg_string = vec_to_string(svg);
|
||||
let img = document.getElementById("map");
|
||||
gps_content = get_gps_content(gps_data);
|
||||
let svg_string = get_gps_map_svg(gps_data);
|
||||
console.log("svg string is", svg_string);
|
||||
let img = document.getElementById("svgmap");
|
||||
img.innerHTML = svg_string;
|
||||
gpc_content = get_gpc(gs);
|
||||
if (gpc_filename !== null) {
|
||||
if (gps_filename !== null) {
|
||||
document.getElementById('upload').disabled = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
document
|
||||
.getElementById("gpc_file")
|
||||
.getElementById("gps_file")
|
||||
.addEventListener('change', function() {
|
||||
gpc_filename = document.getElementById("gpc_file").value;
|
||||
if (gpc_filename == "") {
|
||||
gps_filename = document.getElementById("gps_file").value;
|
||||
if (gps_filename == "") {
|
||||
document.getElementById("upload").disabled = true;
|
||||
} else {
|
||||
if (gpc_content !== null) {
|
||||
if (gps_content !== null) {
|
||||
document.getElementById("upload").disabled = false;
|
||||
}
|
||||
}
|
||||
|
@ -185,12 +230,12 @@ document
|
|||
document.getElementById('upload').disabled = true;
|
||||
status.innerHTML = "uploading file";
|
||||
console.log("uploading");
|
||||
let gpc_string = vec_to_string(gpc_content);
|
||||
Util.writeStorage(gpc_filename + ".gpc", gpc_string, () => {
|
||||
let gps_string = vec_to_string(gps_content);
|
||||
Util.writeStorage(gps_filename + ".gps", gps_string, () => {
|
||||
status.innerHTML = "Checking upload";
|
||||
Util.readStorage(gpc_filename + ".gpc", uploaded_content => {
|
||||
if (uploaded_content == gpc_string) {
|
||||
status.innerHTML = `${gpc_filename}.gpc uploaded`;
|
||||
Util.readStorage(gps_filename + ".gps", uploaded_content => {
|
||||
if (uploaded_content == gps_string) {
|
||||
status.innerHTML = `${gps_filename}.gps uploaded`;
|
||||
console.log("DONE");
|
||||
} else {
|
||||
status.innerHTML = "Upload FAILED";
|
||||
|
@ -198,6 +243,7 @@ document
|
|||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 18 KiB |
|
@ -1,75 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* @param {GpcSvg} gpcsvg
|
||||
* @returns {Uint8Array}
|
||||
*/
|
||||
export function get_gpc(gpcsvg: GpcSvg): Uint8Array;
|
||||
/**
|
||||
* @param {GpcSvg} gpcsvg
|
||||
* @returns {Uint8Array}
|
||||
*/
|
||||
export function get_svg(gpcsvg: GpcSvg): Uint8Array;
|
||||
/**
|
||||
* @param {string} input_str
|
||||
* @returns {Promise<GpcSvg>}
|
||||
*/
|
||||
export function convert_gpx_strings_no_osm(input_str: string): Promise<GpcSvg>;
|
||||
/**
|
||||
* @param {string} input_str
|
||||
* @param {string} key1
|
||||
* @param {string} value1
|
||||
* @param {string} key2
|
||||
* @param {string} value2
|
||||
* @param {string} key3
|
||||
* @param {string} value3
|
||||
* @param {string} key4
|
||||
* @param {string} value4
|
||||
* @returns {Promise<GpcSvg>}
|
||||
*/
|
||||
export function convert_gpx_strings(input_str: string, key1: string, value1: string, key2: string, value2: string, key3: string, value3: string, key4: string, value4: string): Promise<GpcSvg>;
|
||||
/**
|
||||
*/
|
||||
export class GpcSvg {
|
||||
free(): void;
|
||||
}
|
||||
|
||||
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
||||
|
||||
export interface InitOutput {
|
||||
readonly memory: WebAssembly.Memory;
|
||||
readonly __wbg_gpcsvg_free: (a: number) => void;
|
||||
readonly get_gpc: (a: number, b: number) => void;
|
||||
readonly get_svg: (a: number, b: number) => void;
|
||||
readonly convert_gpx_strings_no_osm: (a: number, b: number) => number;
|
||||
readonly convert_gpx_strings: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number) => number;
|
||||
readonly __wbindgen_malloc: (a: number) => number;
|
||||
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
|
||||
readonly __wbindgen_export_2: WebAssembly.Table;
|
||||
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h317df853f2d4653e: (a: number, b: number, c: number) => void;
|
||||
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
||||
readonly __wbindgen_free: (a: number, b: number) => void;
|
||||
readonly __wbindgen_exn_store: (a: number) => void;
|
||||
readonly wasm_bindgen__convert__closures__invoke2_mut__h573cb80e0bf72240: (a: number, b: number, c: number, d: number) => void;
|
||||
}
|
||||
|
||||
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
||||
/**
|
||||
* Instantiates the given `module`, which can either be bytes or
|
||||
* a precompiled `WebAssembly.Module`.
|
||||
*
|
||||
* @param {SyncInitInput} module
|
||||
*
|
||||
* @returns {InitOutput}
|
||||
*/
|
||||
export function initSync(module: SyncInitInput): InitOutput;
|
||||
|
||||
/**
|
||||
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
||||
* for everything else, calls `WebAssembly.instantiate` directly.
|
||||
*
|
||||
* @param {InitInput | Promise<InitInput>} module_or_path
|
||||
*
|
||||
* @returns {Promise<InitOutput>}
|
||||
*/
|
||||
export default function init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
|
Binary file not shown.
|
@ -1,16 +0,0 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const memory: WebAssembly.Memory;
|
||||
export function __wbg_gpcsvg_free(a: number): void;
|
||||
export function get_gpc(a: number, b: number): void;
|
||||
export function get_svg(a: number, b: number): void;
|
||||
export function convert_gpx_strings_no_osm(a: number, b: number): number;
|
||||
export function convert_gpx_strings(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number): number;
|
||||
export function __wbindgen_malloc(a: number): number;
|
||||
export function __wbindgen_realloc(a: number, b: number, c: number): number;
|
||||
export const __wbindgen_export_2: WebAssembly.Table;
|
||||
export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h317df853f2d4653e(a: number, b: number, c: number): void;
|
||||
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
||||
export function __wbindgen_free(a: number, b: number): void;
|
||||
export function __wbindgen_exn_store(a: number): void;
|
||||
export function wasm_bindgen__convert__closures__invoke2_mut__h573cb80e0bf72240(a: number, b: number, c: number, d: number): void;
|
|
@ -0,0 +1,90 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* @param {Gps} gps
|
||||
* @returns {Float64Array}
|
||||
*/
|
||||
export function get_polygon(gps: Gps): Float64Array;
|
||||
/**
|
||||
* @param {Gps} gps
|
||||
* @returns {Uint8Array}
|
||||
*/
|
||||
export function get_gps_content(gps: Gps): Uint8Array;
|
||||
/**
|
||||
* @param {Gps} gps
|
||||
* @returns {string}
|
||||
*/
|
||||
export function get_gps_map_svg(gps: Gps): string;
|
||||
/**
|
||||
* @param {Gps} gps
|
||||
* @param {string} key1
|
||||
* @param {string} value1
|
||||
* @param {string} key2
|
||||
* @param {string} value2
|
||||
* @param {string} key3
|
||||
* @param {string} value3
|
||||
* @param {string} key4
|
||||
* @param {string} value4
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
export function request_map(gps: Gps, key1: string, value1: string, key2: string, value2: string, key3: string, value3: string, key4: string, value4: string): Promise<void>;
|
||||
/**
|
||||
* @param {string} input
|
||||
* @returns {Gps}
|
||||
*/
|
||||
export function load_gps_from_string(input: string): Gps;
|
||||
/**
|
||||
* @param {number} xmin
|
||||
* @param {number} ymin
|
||||
* @param {number} xmax
|
||||
* @param {number} ymax
|
||||
* @returns {Gps}
|
||||
*/
|
||||
export function gps_from_area(xmin: number, ymin: number, xmax: number, ymax: number): Gps;
|
||||
/**
|
||||
*/
|
||||
export class Gps {
|
||||
free(): void;
|
||||
}
|
||||
|
||||
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
||||
|
||||
export interface InitOutput {
|
||||
readonly memory: WebAssembly.Memory;
|
||||
readonly __wbg_gps_free: (a: number) => void;
|
||||
readonly get_polygon: (a: number, b: number) => void;
|
||||
readonly get_gps_content: (a: number, b: number) => void;
|
||||
readonly get_gps_map_svg: (a: number, b: number) => void;
|
||||
readonly request_map: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number) => number;
|
||||
readonly load_gps_from_string: (a: number, b: number) => number;
|
||||
readonly gps_from_area: (a: number, b: number, c: number, d: number) => number;
|
||||
readonly __wbindgen_malloc: (a: number) => number;
|
||||
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
|
||||
readonly __wbindgen_export_2: WebAssembly.Table;
|
||||
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6bb6801698d941c0: (a: number, b: number, c: number) => void;
|
||||
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
||||
readonly __wbindgen_free: (a: number, b: number) => void;
|
||||
readonly __wbindgen_exn_store: (a: number) => void;
|
||||
readonly wasm_bindgen__convert__closures__invoke2_mut__h33169a25550cd50b: (a: number, b: number, c: number, d: number) => void;
|
||||
}
|
||||
|
||||
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
||||
/**
|
||||
* Instantiates the given `module`, which can either be bytes or
|
||||
* a precompiled `WebAssembly.Module`.
|
||||
*
|
||||
* @param {SyncInitInput} module
|
||||
*
|
||||
* @returns {InitOutput}
|
||||
*/
|
||||
export function initSync(module: SyncInitInput): InitOutput;
|
||||
|
||||
/**
|
||||
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
||||
* for everything else, calls `WebAssembly.instantiate` directly.
|
||||
*
|
||||
* @param {InitInput | Promise<InitInput>} module_or_path
|
||||
*
|
||||
* @returns {Promise<InitOutput>}
|
||||
*/
|
||||
export default function init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
@ -7,20 +7,6 @@ heap.push(undefined, null, true, false);
|
|||
|
||||
function getObject(idx) { return heap[idx]; }
|
||||
|
||||
let heap_next = heap.length;
|
||||
|
||||
function dropObject(idx) {
|
||||
if (idx < 36) return;
|
||||
heap[idx] = heap_next;
|
||||
heap_next = idx;
|
||||
}
|
||||
|
||||
function takeObject(idx) {
|
||||
const ret = getObject(idx);
|
||||
dropObject(idx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
let WASM_VECTOR_LEN = 0;
|
||||
|
||||
let cachedUint8Memory0 = new Uint8Array();
|
||||
|
@ -98,6 +84,20 @@ function getInt32Memory0() {
|
|||
return cachedInt32Memory0;
|
||||
}
|
||||
|
||||
let heap_next = heap.length;
|
||||
|
||||
function dropObject(idx) {
|
||||
if (idx < 36) return;
|
||||
heap[idx] = heap_next;
|
||||
heap_next = idx;
|
||||
}
|
||||
|
||||
function takeObject(idx) {
|
||||
const ret = getObject(idx);
|
||||
dropObject(idx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
function addHeapObject(obj) {
|
||||
if (heap_next === heap.length) heap.push(heap.length + 1);
|
||||
const idx = heap_next;
|
||||
|
@ -205,7 +205,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|||
return real;
|
||||
}
|
||||
function __wbg_adapter_24(arg0, arg1, arg2) {
|
||||
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h317df853f2d4653e(arg0, arg1, addHeapObject(arg2));
|
||||
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6bb6801698d941c0(arg0, arg1, addHeapObject(arg2));
|
||||
}
|
||||
|
||||
function _assertClass(instance, klass) {
|
||||
|
@ -215,18 +215,49 @@ function _assertClass(instance, klass) {
|
|||
return instance.ptr;
|
||||
}
|
||||
|
||||
let cachedFloat64Memory0 = new Float64Array();
|
||||
|
||||
function getFloat64Memory0() {
|
||||
if (cachedFloat64Memory0.byteLength === 0) {
|
||||
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
||||
}
|
||||
return cachedFloat64Memory0;
|
||||
}
|
||||
|
||||
function getArrayF64FromWasm0(ptr, len) {
|
||||
return getFloat64Memory0().subarray(ptr / 8, ptr / 8 + len);
|
||||
}
|
||||
/**
|
||||
* @param {Gps} gps
|
||||
* @returns {Float64Array}
|
||||
*/
|
||||
export function get_polygon(gps) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
_assertClass(gps, Gps);
|
||||
wasm.get_polygon(retptr, gps.ptr);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var v0 = getArrayF64FromWasm0(r0, r1).slice();
|
||||
wasm.__wbindgen_free(r0, r1 * 8);
|
||||
return v0;
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
|
||||
function getArrayU8FromWasm0(ptr, len) {
|
||||
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
||||
}
|
||||
/**
|
||||
* @param {GpcSvg} gpcsvg
|
||||
* @param {Gps} gps
|
||||
* @returns {Uint8Array}
|
||||
*/
|
||||
export function get_gpc(gpcsvg) {
|
||||
export function get_gps_content(gps) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
_assertClass(gpcsvg, GpcSvg);
|
||||
wasm.get_gpc(retptr, gpcsvg.ptr);
|
||||
_assertClass(gps, Gps);
|
||||
wasm.get_gps_content(retptr, gps.ptr);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var v0 = getArrayU8FromWasm0(r0, r1).slice();
|
||||
|
@ -238,37 +269,25 @@ export function get_gpc(gpcsvg) {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param {GpcSvg} gpcsvg
|
||||
* @returns {Uint8Array}
|
||||
* @param {Gps} gps
|
||||
* @returns {string}
|
||||
*/
|
||||
export function get_svg(gpcsvg) {
|
||||
export function get_gps_map_svg(gps) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
_assertClass(gpcsvg, GpcSvg);
|
||||
wasm.get_svg(retptr, gpcsvg.ptr);
|
||||
_assertClass(gps, Gps);
|
||||
wasm.get_gps_map_svg(retptr, gps.ptr);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var v0 = getArrayU8FromWasm0(r0, r1).slice();
|
||||
wasm.__wbindgen_free(r0, r1 * 1);
|
||||
return v0;
|
||||
return getStringFromWasm0(r0, r1);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
wasm.__wbindgen_free(r0, r1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} input_str
|
||||
* @returns {Promise<GpcSvg>}
|
||||
*/
|
||||
export function convert_gpx_strings_no_osm(input_str) {
|
||||
const ptr0 = passStringToWasm0(input_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
const ret = wasm.convert_gpx_strings_no_osm(ptr0, len0);
|
||||
return takeObject(ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} input_str
|
||||
* @param {Gps} gps
|
||||
* @param {string} key1
|
||||
* @param {string} value1
|
||||
* @param {string} key2
|
||||
|
@ -277,31 +296,53 @@ export function convert_gpx_strings_no_osm(input_str) {
|
|||
* @param {string} value3
|
||||
* @param {string} key4
|
||||
* @param {string} value4
|
||||
* @returns {Promise<GpcSvg>}
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
export function convert_gpx_strings(input_str, key1, value1, key2, value2, key3, value3, key4, value4) {
|
||||
const ptr0 = passStringToWasm0(input_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
export function request_map(gps, key1, value1, key2, value2, key3, value3, key4, value4) {
|
||||
_assertClass(gps, Gps);
|
||||
const ptr0 = passStringToWasm0(key1, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
const ptr1 = passStringToWasm0(key1, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const ptr1 = passStringToWasm0(value1, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len1 = WASM_VECTOR_LEN;
|
||||
const ptr2 = passStringToWasm0(value1, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const ptr2 = passStringToWasm0(key2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len2 = WASM_VECTOR_LEN;
|
||||
const ptr3 = passStringToWasm0(key2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const ptr3 = passStringToWasm0(value2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len3 = WASM_VECTOR_LEN;
|
||||
const ptr4 = passStringToWasm0(value2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const ptr4 = passStringToWasm0(key3, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len4 = WASM_VECTOR_LEN;
|
||||
const ptr5 = passStringToWasm0(key3, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const ptr5 = passStringToWasm0(value3, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len5 = WASM_VECTOR_LEN;
|
||||
const ptr6 = passStringToWasm0(value3, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const ptr6 = passStringToWasm0(key4, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len6 = WASM_VECTOR_LEN;
|
||||
const ptr7 = passStringToWasm0(key4, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const ptr7 = passStringToWasm0(value4, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len7 = WASM_VECTOR_LEN;
|
||||
const ptr8 = passStringToWasm0(value4, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len8 = WASM_VECTOR_LEN;
|
||||
const ret = wasm.convert_gpx_strings(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6, ptr7, len7, ptr8, len8);
|
||||
const ret = wasm.request_map(gps.ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6, ptr7, len7);
|
||||
return takeObject(ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} input
|
||||
* @returns {Gps}
|
||||
*/
|
||||
export function load_gps_from_string(input) {
|
||||
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
const ret = wasm.load_gps_from_string(ptr0, len0);
|
||||
return Gps.__wrap(ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {number} xmin
|
||||
* @param {number} ymin
|
||||
* @param {number} xmax
|
||||
* @param {number} ymax
|
||||
* @returns {Gps}
|
||||
*/
|
||||
export function gps_from_area(xmin, ymin, xmax, ymax) {
|
||||
const ret = wasm.gps_from_area(xmin, ymin, xmax, ymax);
|
||||
return Gps.__wrap(ret);
|
||||
}
|
||||
|
||||
function handleError(f, args) {
|
||||
try {
|
||||
return f.apply(this, args);
|
||||
|
@ -309,16 +350,16 @@ function handleError(f, args) {
|
|||
wasm.__wbindgen_exn_store(addHeapObject(e));
|
||||
}
|
||||
}
|
||||
function __wbg_adapter_69(arg0, arg1, arg2, arg3) {
|
||||
wasm.wasm_bindgen__convert__closures__invoke2_mut__h573cb80e0bf72240(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
||||
function __wbg_adapter_83(arg0, arg1, arg2, arg3) {
|
||||
wasm.wasm_bindgen__convert__closures__invoke2_mut__h33169a25550cd50b(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
export class GpcSvg {
|
||||
export class Gps {
|
||||
|
||||
static __wrap(ptr) {
|
||||
const obj = Object.create(GpcSvg.prototype);
|
||||
const obj = Object.create(Gps.prototype);
|
||||
obj.ptr = ptr;
|
||||
|
||||
return obj;
|
||||
|
@ -333,7 +374,7 @@ export class GpcSvg {
|
|||
|
||||
free() {
|
||||
const ptr = this.__destroy_into_raw();
|
||||
wasm.__wbg_gpcsvg_free(ptr);
|
||||
wasm.__wbg_gps_free(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -371,12 +412,8 @@ async function load(module, imports) {
|
|||
function getImports() {
|
||||
const imports = {};
|
||||
imports.wbg = {};
|
||||
imports.wbg.__wbg_gpcsvg_new = function(arg0) {
|
||||
const ret = GpcSvg.__wrap(arg0);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
||||
takeObject(arg0);
|
||||
imports.wbg.__wbg_log_d04343b58be82b0f = function(arg0, arg1) {
|
||||
console.log(getStringFromWasm0(arg0, arg1));
|
||||
};
|
||||
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
||||
const obj = getObject(arg1);
|
||||
|
@ -386,6 +423,9 @@ function getImports() {
|
|||
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
||||
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
||||
};
|
||||
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
||||
takeObject(arg0);
|
||||
};
|
||||
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
||||
const ret = getObject(arg0);
|
||||
return addHeapObject(ret);
|
||||
|
@ -394,10 +434,83 @@ function getImports() {
|
|||
const ret = getStringFromWasm0(arg0, arg1);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_fetch_3894579f6e2af3be = function(arg0) {
|
||||
imports.wbg.__wbg_fetch_56a6919da5e4c21c = function(arg0) {
|
||||
const ret = fetch(getObject(arg0));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_fetch_a48a10a635c75705 = function(arg0, arg1) {
|
||||
const ret = getObject(arg0).fetch(getObject(arg1));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_new_79046c4e23ea4a68 = function() { return handleError(function () {
|
||||
const ret = new Headers();
|
||||
return addHeapObject(ret);
|
||||
}, arguments) };
|
||||
imports.wbg.__wbg_append_419e47e76db2bf58 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
||||
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
||||
}, arguments) };
|
||||
imports.wbg.__wbg_newwithstrandinit_88469b4854505aec = function() { return handleError(function (arg0, arg1, arg2) {
|
||||
const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
|
||||
return addHeapObject(ret);
|
||||
}, arguments) };
|
||||
imports.wbg.__wbg_signal_ef3cb12ade6e3e58 = function(arg0) {
|
||||
const ret = getObject(arg0).signal;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_new_0660dc54dc784268 = function() { return handleError(function () {
|
||||
const ret = new AbortController();
|
||||
return addHeapObject(ret);
|
||||
}, arguments) };
|
||||
imports.wbg.__wbg_abort_5eaedf61218dad4e = function(arg0) {
|
||||
getObject(arg0).abort();
|
||||
};
|
||||
imports.wbg.__wbg_instanceof_Response_f5253ba882b9f20c = function(arg0) {
|
||||
let result;
|
||||
try {
|
||||
result = getObject(arg0) instanceof Response;
|
||||
} catch {
|
||||
result = false;
|
||||
}
|
||||
const ret = result;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_url_31e1075302fd753f = function(arg0, arg1) {
|
||||
const ret = getObject(arg1).url;
|
||||
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
||||
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
||||
};
|
||||
imports.wbg.__wbg_status_b1116741940de98b = function(arg0) {
|
||||
const ret = getObject(arg0).status;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_headers_bb43d11ba08fa4bd = function(arg0) {
|
||||
const ret = getObject(arg0).headers;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_text_84312300339af335 = function() { return handleError(function (arg0) {
|
||||
const ret = getObject(arg0).text();
|
||||
return addHeapObject(ret);
|
||||
}, arguments) };
|
||||
imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
|
||||
const ret = new Error();
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
|
||||
const ret = getObject(arg1).stack;
|
||||
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
||||
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
||||
};
|
||||
imports.wbg.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
|
||||
try {
|
||||
console.error(getStringFromWasm0(arg0, arg1));
|
||||
} finally {
|
||||
wasm.__wbindgen_free(arg0, arg1);
|
||||
}
|
||||
};
|
||||
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
||||
const obj = takeObject(arg0).original;
|
||||
if (obj.cnt-- == 1) {
|
||||
|
@ -407,60 +520,16 @@ function getImports() {
|
|||
const ret = false;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_fetch_749a56934f95c96c = function(arg0, arg1) {
|
||||
const ret = getObject(arg0).fetch(getObject(arg1));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_instanceof_Response_eaa426220848a39e = function(arg0) {
|
||||
let result;
|
||||
try {
|
||||
result = getObject(arg0) instanceof Response;
|
||||
} catch {
|
||||
result = false;
|
||||
}
|
||||
const ret = result;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_url_74285ddf2747cb3d = function(arg0, arg1) {
|
||||
const ret = getObject(arg1).url;
|
||||
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
||||
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
||||
};
|
||||
imports.wbg.__wbg_status_c4ef3dd591e63435 = function(arg0) {
|
||||
const ret = getObject(arg0).status;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_headers_fd64ad685cf22e5d = function(arg0) {
|
||||
const ret = getObject(arg0).headers;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_text_1169d752cc697903 = function() { return handleError(function (arg0) {
|
||||
const ret = getObject(arg0).text();
|
||||
return addHeapObject(ret);
|
||||
}, arguments) };
|
||||
imports.wbg.__wbg_newwithstrandinit_05d7180788420c40 = function() { return handleError(function (arg0, arg1, arg2) {
|
||||
const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
|
||||
return addHeapObject(ret);
|
||||
}, arguments) };
|
||||
imports.wbg.__wbg_new_2d0053ee81e4dd2a = function() { return handleError(function () {
|
||||
const ret = new Headers();
|
||||
return addHeapObject(ret);
|
||||
}, arguments) };
|
||||
imports.wbg.__wbg_append_de37df908812970d = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
||||
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
||||
}, arguments) };
|
||||
imports.wbg.__wbindgen_is_object = function(arg0) {
|
||||
const val = getObject(arg0);
|
||||
const ret = typeof(val) === 'object' && val !== null;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_newnoargs_b5b063fc6c2f0376 = function(arg0, arg1) {
|
||||
imports.wbg.__wbg_newnoargs_e60ecc77c37e3a52 = function(arg0, arg1) {
|
||||
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_next_579e583d33566a86 = function(arg0) {
|
||||
imports.wbg.__wbg_next_204d18f7da3b87aa = function(arg0) {
|
||||
const ret = getObject(arg0).next;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
@ -468,31 +537,31 @@ function getImports() {
|
|||
const ret = typeof(getObject(arg0)) === 'function';
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_value_1ccc36bc03462d71 = function(arg0) {
|
||||
imports.wbg.__wbg_value_55672421087ba68e = function(arg0) {
|
||||
const ret = getObject(arg0).value;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_iterator_6f9d4f28845f426c = function() {
|
||||
imports.wbg.__wbg_iterator_06c08a312c33a792 = function() {
|
||||
const ret = Symbol.iterator;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_new_0b9bfdd97583284e = function() {
|
||||
imports.wbg.__wbg_new_c985446080b753ed = function() {
|
||||
const ret = new Object();
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_self_6d479506f72c6a71 = function() { return handleError(function () {
|
||||
imports.wbg.__wbg_self_6626a919974a3fe1 = function() { return handleError(function () {
|
||||
const ret = self.self;
|
||||
return addHeapObject(ret);
|
||||
}, arguments) };
|
||||
imports.wbg.__wbg_window_f2557cc78490aceb = function() { return handleError(function () {
|
||||
imports.wbg.__wbg_window_53efdaa5bfb50c7e = function() { return handleError(function () {
|
||||
const ret = window.window;
|
||||
return addHeapObject(ret);
|
||||
}, arguments) };
|
||||
imports.wbg.__wbg_globalThis_7f206bda628d5286 = function() { return handleError(function () {
|
||||
imports.wbg.__wbg_globalThis_1d749c41ddffdb92 = function() { return handleError(function () {
|
||||
const ret = globalThis.globalThis;
|
||||
return addHeapObject(ret);
|
||||
}, arguments) };
|
||||
imports.wbg.__wbg_global_ba75c50d1cf384f4 = function() { return handleError(function () {
|
||||
imports.wbg.__wbg_global_ab5d31db46028bf4 = function() { return handleError(function () {
|
||||
const ret = global.global;
|
||||
return addHeapObject(ret);
|
||||
}, arguments) };
|
||||
|
@ -500,30 +569,30 @@ function getImports() {
|
|||
const ret = getObject(arg0) === undefined;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_call_97ae9d8645dc388b = function() { return handleError(function (arg0, arg1) {
|
||||
imports.wbg.__wbg_call_f14a389d3721b1c3 = function() { return handleError(function (arg0, arg1) {
|
||||
const ret = getObject(arg0).call(getObject(arg1));
|
||||
return addHeapObject(ret);
|
||||
}, arguments) };
|
||||
imports.wbg.__wbg_call_168da88779e35f61 = function() { return handleError(function (arg0, arg1, arg2) {
|
||||
imports.wbg.__wbg_call_fd5f197e56af4014 = function() { return handleError(function (arg0, arg1, arg2) {
|
||||
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
||||
return addHeapObject(ret);
|
||||
}, arguments) };
|
||||
imports.wbg.__wbg_next_aaef7c8aa5e212ac = function() { return handleError(function (arg0) {
|
||||
imports.wbg.__wbg_next_74bb1f65e2afa2ac = function() { return handleError(function (arg0) {
|
||||
const ret = getObject(arg0).next();
|
||||
return addHeapObject(ret);
|
||||
}, arguments) };
|
||||
imports.wbg.__wbg_done_1b73b0672e15f234 = function(arg0) {
|
||||
imports.wbg.__wbg_done_3a03f6e9c5c77561 = function(arg0) {
|
||||
const ret = getObject(arg0).done;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_new_9962f939219f1820 = function(arg0, arg1) {
|
||||
imports.wbg.__wbg_new_54a2183d2c64f703 = function(arg0, arg1) {
|
||||
try {
|
||||
var state0 = {a: arg0, b: arg1};
|
||||
var cb0 = (arg0, arg1) => {
|
||||
const a = state0.a;
|
||||
state0.a = 0;
|
||||
try {
|
||||
return __wbg_adapter_69(a, state0.b, arg0, arg1);
|
||||
return __wbg_adapter_83(a, state0.b, arg0, arg1);
|
||||
} finally {
|
||||
state0.a = a;
|
||||
}
|
||||
|
@ -534,46 +603,46 @@ function getImports() {
|
|||
state0.a = state0.b = 0;
|
||||
}
|
||||
};
|
||||
imports.wbg.__wbg_resolve_99fe17964f31ffc0 = function(arg0) {
|
||||
imports.wbg.__wbg_resolve_06857cc092d7a5a5 = function(arg0) {
|
||||
const ret = Promise.resolve(getObject(arg0));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_then_11f7a54d67b4bfad = function(arg0, arg1) {
|
||||
imports.wbg.__wbg_then_9d00e221486eb3fd = function(arg0, arg1) {
|
||||
const ret = getObject(arg0).then(getObject(arg1));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_then_cedad20fbbd9418a = function(arg0, arg1, arg2) {
|
||||
imports.wbg.__wbg_then_1a0d89f52d89bc91 = function(arg0, arg1, arg2) {
|
||||
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_buffer_3f3d764d4747d564 = function(arg0) {
|
||||
imports.wbg.__wbg_buffer_dbc8aa65574f18f0 = function(arg0) {
|
||||
const ret = getObject(arg0).buffer;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_newwithbyteoffsetandlength_d9aa266703cb98be = function(arg0, arg1, arg2) {
|
||||
imports.wbg.__wbg_newwithbyteoffsetandlength_dc61a8150553a946 = function(arg0, arg1, arg2) {
|
||||
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_new_8c3f0052272a457a = function(arg0) {
|
||||
imports.wbg.__wbg_new_397df785177a4c42 = function(arg0) {
|
||||
const ret = new Uint8Array(getObject(arg0));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_get_765201544a2b6869 = function() { return handleError(function (arg0, arg1) {
|
||||
imports.wbg.__wbg_stringify_4f9ffcaf0f4c3046 = function() { return handleError(function (arg0) {
|
||||
const ret = JSON.stringify(getObject(arg0));
|
||||
return addHeapObject(ret);
|
||||
}, arguments) };
|
||||
imports.wbg.__wbg_get_838d84ef03e3a353 = function() { return handleError(function (arg0, arg1) {
|
||||
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
||||
return addHeapObject(ret);
|
||||
}, arguments) };
|
||||
imports.wbg.__wbg_has_8359f114ce042f5a = function() { return handleError(function (arg0, arg1) {
|
||||
imports.wbg.__wbg_has_d8ce53e88270beb1 = function() { return handleError(function (arg0, arg1) {
|
||||
const ret = Reflect.has(getObject(arg0), getObject(arg1));
|
||||
return ret;
|
||||
}, arguments) };
|
||||
imports.wbg.__wbg_set_bf3f89b92d5a34bf = function() { return handleError(function (arg0, arg1, arg2) {
|
||||
imports.wbg.__wbg_set_c1da7a4e82cfe2ad = function() { return handleError(function (arg0, arg1, arg2) {
|
||||
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
||||
return ret;
|
||||
}, arguments) };
|
||||
imports.wbg.__wbg_stringify_d6471d300ded9b68 = function() { return handleError(function (arg0) {
|
||||
const ret = JSON.stringify(getObject(arg0));
|
||||
return addHeapObject(ret);
|
||||
}, arguments) };
|
||||
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
||||
const ret = debugString(getObject(arg1));
|
||||
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
|
@ -588,8 +657,8 @@ function getImports() {
|
|||
const ret = wasm.memory;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbindgen_closure_wrapper929 = function(arg0, arg1, arg2) {
|
||||
const ret = makeMutClosure(arg0, arg1, 143, __wbg_adapter_24);
|
||||
imports.wbg.__wbindgen_closure_wrapper2246 = function(arg0, arg1, arg2) {
|
||||
const ret = makeMutClosure(arg0, arg1, 285, __wbg_adapter_24);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
|
@ -603,6 +672,7 @@ function initMemory(imports, maybe_memory) {
|
|||
function finalizeInit(instance, module) {
|
||||
wasm = instance.exports;
|
||||
init.__wbindgen_wasm_module = module;
|
||||
cachedFloat64Memory0 = new Float64Array();
|
||||
cachedInt32Memory0 = new Int32Array();
|
||||
cachedUint8Memory0 = new Uint8Array();
|
||||
|
||||
|
@ -626,7 +696,7 @@ function initSync(module) {
|
|||
|
||||
async function init(input) {
|
||||
if (typeof input === 'undefined') {
|
||||
input = new URL('gpconv_bg.wasm', import.meta.url);
|
||||
input = new URL('gps_bg.wasm', import.meta.url);
|
||||
}
|
||||
const imports = getImports();
|
||||
|
Binary file not shown.
|
@ -0,0 +1,18 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const memory: WebAssembly.Memory;
|
||||
export function __wbg_gps_free(a: number): void;
|
||||
export function get_polygon(a: number, b: number): void;
|
||||
export function get_gps_content(a: number, b: number): void;
|
||||
export function get_gps_map_svg(a: number, b: number): void;
|
||||
export function request_map(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number): number;
|
||||
export function load_gps_from_string(a: number, b: number): number;
|
||||
export function gps_from_area(a: number, b: number, c: number, d: number): number;
|
||||
export function __wbindgen_malloc(a: number): number;
|
||||
export function __wbindgen_realloc(a: number, b: number, c: number): number;
|
||||
export const __wbindgen_export_2: WebAssembly.Table;
|
||||
export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6bb6801698d941c0(a: number, b: number, c: number): void;
|
||||
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
||||
export function __wbindgen_free(a: number, b: number): void;
|
||||
export function __wbindgen_exn_store(a: number): void;
|
||||
export function wasm_bindgen__convert__closures__invoke2_mut__h33169a25550cd50b(a: number, b: number, c: number, d: number): void;
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "gpconv",
|
||||
"name": "gps",
|
||||
"version": "0.1.0",
|
||||
"files": [
|
||||
"gpconv_bg.wasm",
|
||||
"gpconv.js",
|
||||
"gpconv.d.ts"
|
||||
"gps_bg.wasm",
|
||||
"gps.js",
|
||||
"gps.d.ts"
|
||||
],
|
||||
"module": "gpconv.js",
|
||||
"types": "gpconv.d.ts",
|
||||
"module": "gps.js",
|
||||
"types": "gps.d.ts",
|
||||
"sideEffects": false
|
||||
}
|
|
@ -3,8 +3,7 @@
|
|||
// Load settings
|
||||
var settings = Object.assign(
|
||||
{
|
||||
keep_gps_alive: false,
|
||||
max_speed: 35,
|
||||
lost_distance: 50,
|
||||
},
|
||||
require("Storage").readJSON(FILE, true) || {}
|
||||
);
|
||||
|
@ -19,7 +18,8 @@
|
|||
"< Back": () => back(),
|
||||
"keep gps alive": {
|
||||
value: !!settings.keep_gps_alive, // !! converts undefined to false
|
||||
onchange: v => {
|
||||
format: (v) => (v ? "Yes" : "No"),
|
||||
onchange: (v) => {
|
||||
settings.keep_gps_alive = v;
|
||||
writeSettings();
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue