1
0
Fork 0

gipy: major release

we now have a tile based display
master
frederic wagner 2023-06-20 16:50:13 +02:00
parent e52e89f204
commit 3995df7fdb
14 changed files with 1488 additions and 706 deletions

View File

@ -74,4 +74,6 @@
* Avoid angles flickering at low speed at the cost of less refresh. * Avoid angles flickering at low speed at the cost of less refresh.
* Splash screen while waiting for gps signal. * 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.

View File

@ -16,6 +16,7 @@ This software is not perfect but surprisingly useful.
It provides the following features : It provides the following features :
- display the path with current position from gps - 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 - detects and buzzes if you leave the path
- buzzes before sharp turns - buzzes before sharp turns
- buzzes before waypoints - buzzes before waypoints
@ -28,17 +29,14 @@ It provides the following features :
- artwork - artwork
- bakeries - bakeries
optionally it can also:
- try to turn off gps between crossroads to save battery
## Usage ## Usage
### Preparing the file ### Preparing the file
You first need to have a trace file in *gpx* format. You first need to have a trace file in *gpx* format.
Usually I download from [komoot](https://www.komoot.com/) or I export 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. 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. 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:
![Screenshot](legend.png) ![Screenshot](legend.png)
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: On your screen you can see:
- yourself (the big black dot) - yourself (the big black dot)
- the path (the top of the screen is in front of you) - the path (thick red line)
- on the path, current and next segments are red and other ones are black - a green arrow telling you which way is forward
- if needed a projection of yourself on the path (small black dot) - if needed a projection of yourself on the path (small black dot)
- points as white dots - waypoints as large white dots
- waypoints as doubled white dots
- some text on the left (from top to bottom): - some text on the left (from top to bottom):
* time to reach start point at current average speed
* current time * current time
* time to reach end point at current average speed * time to reach end point at current average speed
* left distance till end of current segment * 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 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. are. On path it just needed to scan a few points ahead and behind.
![Lost](lost.png)
The distance to next point displayed corresponds to the length of the black segment. 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 ### Settings
Few settings for now (feel free to suggest me more) : 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 - lost distance : at which distance from path are you considered to be lost ?
- max speed : used to compute how long to turn the gps off
- display points : display/hide points (not waypoints)
### Caveats ### 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). - 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. - 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** - 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. - sometimes the watch will tell you that you are lost but you are in fact on the path. It usually figures again
- battery saving by turning off gps is not very well tested (disabled by default). 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 :-(. - 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. - 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, - be careful when **GOING DOWNHILL AT VERY HIGH SPEED**. I already missed a few turning points and by the time I realized it,

File diff suppressed because it is too large Load Diff

View File

@ -1,21 +1,27 @@
<html> <html>
<head> <head>
<link rel="stylesheet" href="../../css/spectre.min.css"> <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> <style>
svg { width:95% } #svgmap { width: 95%; }
#map { height: 180px; }
</style> </style>
</head> </head>
<body> <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"> gpx file : <input type="file" is="gpx_file" id="fileInput" accept=".gpx">
<br> <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> <br>
<input type="checkbox" id="osm" name="osm" checked>
<label for="osm">fetch interests from openstreetmap</label>
<table> <table>
<tr> <tr>
<th><bold>OpenstreetMap <a href="https://wiki.openstreetmap.org/wiki/Tags">NODE Tags</a></bold></th> <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> <input type="button" id="upload" name="upload" value="Upload" disabled>
<div id="status"></div> <div id="status"></div>
<div id="map"></div> <div id="svgmap"></div>
<script src="../../core/lib/interface.js"></script> <script src="../../core/lib/interface.js"></script>
<script> <script>
@ -65,40 +71,82 @@ function vec_to_string(vec) {
return final_string; 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"); console.log("imported wasm");
let osm_checkbox = document.querySelector("input[name=osm]"); // start map
let with_osm = true; L.Map.BoxPrinter = L.Map.BoxZoom.extend({
_onMouseUp: function (e) {
osm_checkbox.addEventListener('change', function() { if ((e.which !== 1) && (e.button !== 1)) { return; }
if (this.checked) {
with_osm = true; this._finish();
document.getElementById('key1').disabled = false;
document.getElementById('key2').disabled = false; if (!this._moved) { return; }
document.getElementById('key3').disabled = false; // Postpone to next JS tick so internal click event handling
document.getElementById('key4').disabled = false; // still see it as "moved".
document.getElementById('value1').disabled = false; setTimeout(L.bind(this._resetState, this), 0);
document.getElementById('value2').disabled = false;
document.getElementById('value3').disabled = false; var bounds = new L.LatLngBounds(
document.getElementById('value4').disabled = false; this._map.containerPointToLatLng(this._startPoint),
} else { this._map.containerPointToLatLng(this._point));
with_osm = false; let south_west = bounds.getSouthWest();
document.getElementById('key1').disabled = true; let north_east = bounds.getNorthEast();
document.getElementById('key2').disabled = true; gps_data = gps_from_area(south_west.lng, south_west.lat, north_east.lng, north_east.lat);
document.getElementById('key3').disabled = true; document.getElementById('gps_file').value = "";
document.getElementById('key4').disabled = true; display_polygon(this._map);
document.getElementById('value1').disabled = true;
document.getElementById('value2').disabled = true; this._map.fire('boxzoomend', {boxZoomBounds: bounds});
document.getElementById('value3').disabled = true;
document.getElementById('value4').disabled = true;
} }
}); });
L.Map.mergeOptions({boxPrinter: true});
L.Map.addInitHook('addHandler', 'boxPrinter', L.Map.BoxPrinter);
// now the interactions
let status = document.getElementById("status"); let status = document.getElementById("status");
let gpx_content = null; let gps_data = null;
let gpc_filename = null; let gps_filename = null;
let gpc_content = 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: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map);
document document
.getElementById("fileInput") .getElementById("fileInput")
@ -112,10 +160,10 @@ document
status.innerHTML = "reading file"; status.innerHTML = "reading file";
let gpx_filename = this.files[0].name; let gpx_filename = this.files[0].name;
if (gpc_filename === null || gpc_filename == "") { if (gps_filename === null || gps_filename == "") {
if (gpx_filename.length <= 28) { if (gpx_filename.length <= 28) {
gpc_filename = gpx_filename.slice(0, gpx_filename.length - 4); gps_filename = gpx_filename.slice(0, gpx_filename.length - 4);
document.getElementById('gpc_file').value = gpc_filename; document.getElementById('gps_file').value = gps_filename;
} }
} }
@ -123,8 +171,10 @@ document
reader.onload = function fileReadCompleted() { reader.onload = function fileReadCompleted() {
console.log("reading file completed"); console.log("reading file completed");
status.innerHTML = "file reading completed"; status.innerHTML = "file reading completed";
gpx_content = reader.result; let gpx_content = reader.result;
document.getElementById('convert').disabled = false;
gps_data = load_gps_from_string(gpx_content);
display_polygon(map);
}; };
reader.readAsText(this.files[0]); reader.readAsText(this.files[0]);
}); });
@ -136,9 +186,6 @@ document
document.getElementById('convert').disabled = true; document.getElementById('convert').disabled = true;
document.getElementById('upload').disabled = true; document.getElementById('upload').disabled = true;
status.innerHTML = "please wait, converting file"; status.innerHTML = "please wait, converting file";
init().then(() => {
let gpc_svg;
if (with_osm) {
let key1 = document.getElementById('key1').value; let key1 = document.getElementById('key1').value;
let key2 = document.getElementById('key2').value; let key2 = document.getElementById('key2').value;
let key3 = document.getElementById('key3').value; let key3 = document.getElementById('key3').value;
@ -147,32 +194,30 @@ document
let value2 = document.getElementById('value2').value; let value2 = document.getElementById('value2').value;
let value3 = document.getElementById('value3').value; let value3 = document.getElementById('value3').value;
let value4 = document.getElementById('value4').value; let value4 = document.getElementById('value4').value;
gpc_svg = convert_gpx_strings(gpx_content, key1, value1, key2, value2, key3, value3, key4, value4); request_map(gps_data, key1, value1, key2, value2, key3, value3, key4, value4).then(
} else { () => {
gpc_svg = convert_gpx_strings_no_osm(gpx_content);
}
gpc_svg.then(gs => {
status.innerHTML = "file converted"; status.innerHTML = "file converted";
let svg = get_svg(gs); gps_content = get_gps_content(gps_data);
let svg_string = vec_to_string(svg); let svg_string = get_gps_map_svg(gps_data);
let img = document.getElementById("map"); console.log("svg string is", svg_string);
let img = document.getElementById("svgmap");
img.innerHTML = svg_string; img.innerHTML = svg_string;
gpc_content = get_gpc(gs); if (gps_filename !== null) {
if (gpc_filename !== null) {
document.getElementById('upload').disabled = false; document.getElementById('upload').disabled = false;
} }
}); }
}); );
}); });
document document
.getElementById("gpc_file") .getElementById("gps_file")
.addEventListener('change', function() { .addEventListener('change', function() {
gpc_filename = document.getElementById("gpc_file").value; gps_filename = document.getElementById("gps_file").value;
if (gpc_filename == "") { if (gps_filename == "") {
document.getElementById("upload").disabled = true; document.getElementById("upload").disabled = true;
} else { } else {
if (gpc_content !== null) { if (gps_content !== null) {
document.getElementById("upload").disabled = false; document.getElementById("upload").disabled = false;
} }
} }
@ -185,12 +230,12 @@ document
document.getElementById('upload').disabled = true; document.getElementById('upload').disabled = true;
status.innerHTML = "uploading file"; status.innerHTML = "uploading file";
console.log("uploading"); console.log("uploading");
let gpc_string = vec_to_string(gpc_content); let gps_string = vec_to_string(gps_content);
Util.writeStorage(gpc_filename + ".gpc", gpc_string, () => { Util.writeStorage(gps_filename + ".gps", gps_string, () => {
status.innerHTML = "Checking upload"; status.innerHTML = "Checking upload";
Util.readStorage(gpc_filename + ".gpc", uploaded_content => { Util.readStorage(gps_filename + ".gps", uploaded_content => {
if (uploaded_content == gpc_string) { if (uploaded_content == gps_string) {
status.innerHTML = `${gpc_filename}.gpc uploaded`; status.innerHTML = `${gps_filename}.gps uploaded`;
console.log("DONE"); console.log("DONE");
} else { } else {
status.innerHTML = "Upload FAILED"; status.innerHTML = "Upload FAILED";
@ -198,6 +243,7 @@ document
} }
}); });
}); });
});
}); });
</script> </script>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -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.

View File

@ -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;

90
apps/gipy/pkg/gps.d.ts vendored Normal file
View File

@ -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>;

View File

@ -7,20 +7,6 @@ heap.push(undefined, null, true, false);
function getObject(idx) { return heap[idx]; } 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 WASM_VECTOR_LEN = 0;
let cachedUint8Memory0 = new Uint8Array(); let cachedUint8Memory0 = new Uint8Array();
@ -98,6 +84,20 @@ function getInt32Memory0() {
return cachedInt32Memory0; 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) { function addHeapObject(obj) {
if (heap_next === heap.length) heap.push(heap.length + 1); if (heap_next === heap.length) heap.push(heap.length + 1);
const idx = heap_next; const idx = heap_next;
@ -205,7 +205,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
return real; return real;
} }
function __wbg_adapter_24(arg0, arg1, arg2) { 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) { function _assertClass(instance, klass) {
@ -215,18 +215,49 @@ function _assertClass(instance, klass) {
return instance.ptr; 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) { function getArrayU8FromWasm0(ptr, len) {
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len); return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
} }
/** /**
* @param {GpcSvg} gpcsvg * @param {Gps} gps
* @returns {Uint8Array} * @returns {Uint8Array}
*/ */
export function get_gpc(gpcsvg) { export function get_gps_content(gps) {
try { try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
_assertClass(gpcsvg, GpcSvg); _assertClass(gps, Gps);
wasm.get_gpc(retptr, gpcsvg.ptr); wasm.get_gps_content(retptr, gps.ptr);
var r0 = getInt32Memory0()[retptr / 4 + 0]; var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1]; var r1 = getInt32Memory0()[retptr / 4 + 1];
var v0 = getArrayU8FromWasm0(r0, r1).slice(); var v0 = getArrayU8FromWasm0(r0, r1).slice();
@ -238,37 +269,25 @@ export function get_gpc(gpcsvg) {
} }
/** /**
* @param {GpcSvg} gpcsvg * @param {Gps} gps
* @returns {Uint8Array} * @returns {string}
*/ */
export function get_svg(gpcsvg) { export function get_gps_map_svg(gps) {
try { try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
_assertClass(gpcsvg, GpcSvg); _assertClass(gps, Gps);
wasm.get_svg(retptr, gpcsvg.ptr); wasm.get_gps_map_svg(retptr, gps.ptr);
var r0 = getInt32Memory0()[retptr / 4 + 0]; var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1]; var r1 = getInt32Memory0()[retptr / 4 + 1];
var v0 = getArrayU8FromWasm0(r0, r1).slice(); return getStringFromWasm0(r0, r1);
wasm.__wbindgen_free(r0, r1 * 1);
return v0;
} finally { } finally {
wasm.__wbindgen_add_to_stack_pointer(16); wasm.__wbindgen_add_to_stack_pointer(16);
wasm.__wbindgen_free(r0, r1);
} }
} }
/** /**
* @param {string} input_str * @param {Gps} gps
* @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 {string} key1 * @param {string} key1
* @param {string} value1 * @param {string} value1
* @param {string} key2 * @param {string} key2
@ -277,31 +296,53 @@ export function convert_gpx_strings_no_osm(input_str) {
* @param {string} value3 * @param {string} value3
* @param {string} key4 * @param {string} key4
* @param {string} value4 * @param {string} value4
* @returns {Promise<GpcSvg>} * @returns {Promise<void>}
*/ */
export function convert_gpx_strings(input_str, key1, value1, key2, value2, key3, value3, key4, value4) { export function request_map(gps, key1, value1, key2, value2, key3, value3, key4, value4) {
const ptr0 = passStringToWasm0(input_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); _assertClass(gps, Gps);
const ptr0 = passStringToWasm0(key1, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len0 = WASM_VECTOR_LEN; 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 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 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 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 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 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 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 len7 = WASM_VECTOR_LEN;
const ptr8 = passStringToWasm0(value4, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const ret = wasm.request_map(gps.ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6, ptr7, len7);
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);
return takeObject(ret); 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) { function handleError(f, args) {
try { try {
return f.apply(this, args); return f.apply(this, args);
@ -309,16 +350,16 @@ function handleError(f, args) {
wasm.__wbindgen_exn_store(addHeapObject(e)); wasm.__wbindgen_exn_store(addHeapObject(e));
} }
} }
function __wbg_adapter_69(arg0, arg1, arg2, arg3) { function __wbg_adapter_83(arg0, arg1, arg2, arg3) {
wasm.wasm_bindgen__convert__closures__invoke2_mut__h573cb80e0bf72240(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); wasm.wasm_bindgen__convert__closures__invoke2_mut__h33169a25550cd50b(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
} }
/** /**
*/ */
export class GpcSvg { export class Gps {
static __wrap(ptr) { static __wrap(ptr) {
const obj = Object.create(GpcSvg.prototype); const obj = Object.create(Gps.prototype);
obj.ptr = ptr; obj.ptr = ptr;
return obj; return obj;
@ -333,7 +374,7 @@ export class GpcSvg {
free() { free() {
const ptr = this.__destroy_into_raw(); 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() { function getImports() {
const imports = {}; const imports = {};
imports.wbg = {}; imports.wbg = {};
imports.wbg.__wbg_gpcsvg_new = function(arg0) { imports.wbg.__wbg_log_d04343b58be82b0f = function(arg0, arg1) {
const ret = GpcSvg.__wrap(arg0); console.log(getStringFromWasm0(arg0, arg1));
return addHeapObject(ret);
};
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
takeObject(arg0);
}; };
imports.wbg.__wbindgen_string_get = function(arg0, arg1) { imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
const obj = getObject(arg1); const obj = getObject(arg1);
@ -386,6 +423,9 @@ function getImports() {
getInt32Memory0()[arg0 / 4 + 1] = len0; getInt32Memory0()[arg0 / 4 + 1] = len0;
getInt32Memory0()[arg0 / 4 + 0] = ptr0; getInt32Memory0()[arg0 / 4 + 0] = ptr0;
}; };
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
takeObject(arg0);
};
imports.wbg.__wbindgen_object_clone_ref = function(arg0) { imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
const ret = getObject(arg0); const ret = getObject(arg0);
return addHeapObject(ret); return addHeapObject(ret);
@ -394,10 +434,83 @@ function getImports() {
const ret = getStringFromWasm0(arg0, arg1); const ret = getStringFromWasm0(arg0, arg1);
return addHeapObject(ret); return addHeapObject(ret);
}; };
imports.wbg.__wbg_fetch_3894579f6e2af3be = function(arg0) { imports.wbg.__wbg_fetch_56a6919da5e4c21c = function(arg0) {
const ret = fetch(getObject(arg0)); const ret = fetch(getObject(arg0));
return addHeapObject(ret); 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) { imports.wbg.__wbindgen_cb_drop = function(arg0) {
const obj = takeObject(arg0).original; const obj = takeObject(arg0).original;
if (obj.cnt-- == 1) { if (obj.cnt-- == 1) {
@ -407,60 +520,16 @@ function getImports() {
const ret = false; const ret = false;
return ret; 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) { imports.wbg.__wbindgen_is_object = function(arg0) {
const val = getObject(arg0); const val = getObject(arg0);
const ret = typeof(val) === 'object' && val !== null; const ret = typeof(val) === 'object' && val !== null;
return ret; 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)); const ret = new Function(getStringFromWasm0(arg0, arg1));
return addHeapObject(ret); return addHeapObject(ret);
}; };
imports.wbg.__wbg_next_579e583d33566a86 = function(arg0) { imports.wbg.__wbg_next_204d18f7da3b87aa = function(arg0) {
const ret = getObject(arg0).next; const ret = getObject(arg0).next;
return addHeapObject(ret); return addHeapObject(ret);
}; };
@ -468,31 +537,31 @@ function getImports() {
const ret = typeof(getObject(arg0)) === 'function'; const ret = typeof(getObject(arg0)) === 'function';
return ret; return ret;
}; };
imports.wbg.__wbg_value_1ccc36bc03462d71 = function(arg0) { imports.wbg.__wbg_value_55672421087ba68e = function(arg0) {
const ret = getObject(arg0).value; const ret = getObject(arg0).value;
return addHeapObject(ret); return addHeapObject(ret);
}; };
imports.wbg.__wbg_iterator_6f9d4f28845f426c = function() { imports.wbg.__wbg_iterator_06c08a312c33a792 = function() {
const ret = Symbol.iterator; const ret = Symbol.iterator;
return addHeapObject(ret); return addHeapObject(ret);
}; };
imports.wbg.__wbg_new_0b9bfdd97583284e = function() { imports.wbg.__wbg_new_c985446080b753ed = function() {
const ret = new Object(); const ret = new Object();
return addHeapObject(ret); 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; const ret = self.self;
return addHeapObject(ret); return addHeapObject(ret);
}, arguments) }; }, arguments) };
imports.wbg.__wbg_window_f2557cc78490aceb = function() { return handleError(function () { imports.wbg.__wbg_window_53efdaa5bfb50c7e = function() { return handleError(function () {
const ret = window.window; const ret = window.window;
return addHeapObject(ret); return addHeapObject(ret);
}, arguments) }; }, arguments) };
imports.wbg.__wbg_globalThis_7f206bda628d5286 = function() { return handleError(function () { imports.wbg.__wbg_globalThis_1d749c41ddffdb92 = function() { return handleError(function () {
const ret = globalThis.globalThis; const ret = globalThis.globalThis;
return addHeapObject(ret); return addHeapObject(ret);
}, arguments) }; }, arguments) };
imports.wbg.__wbg_global_ba75c50d1cf384f4 = function() { return handleError(function () { imports.wbg.__wbg_global_ab5d31db46028bf4 = function() { return handleError(function () {
const ret = global.global; const ret = global.global;
return addHeapObject(ret); return addHeapObject(ret);
}, arguments) }; }, arguments) };
@ -500,30 +569,30 @@ function getImports() {
const ret = getObject(arg0) === undefined; const ret = getObject(arg0) === undefined;
return ret; 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)); const ret = getObject(arg0).call(getObject(arg1));
return addHeapObject(ret); return addHeapObject(ret);
}, arguments) }; }, 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)); const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
return addHeapObject(ret); return addHeapObject(ret);
}, arguments) }; }, 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(); const ret = getObject(arg0).next();
return addHeapObject(ret); return addHeapObject(ret);
}, arguments) }; }, arguments) };
imports.wbg.__wbg_done_1b73b0672e15f234 = function(arg0) { imports.wbg.__wbg_done_3a03f6e9c5c77561 = function(arg0) {
const ret = getObject(arg0).done; const ret = getObject(arg0).done;
return ret; return ret;
}; };
imports.wbg.__wbg_new_9962f939219f1820 = function(arg0, arg1) { imports.wbg.__wbg_new_54a2183d2c64f703 = function(arg0, arg1) {
try { try {
var state0 = {a: arg0, b: arg1}; var state0 = {a: arg0, b: arg1};
var cb0 = (arg0, arg1) => { var cb0 = (arg0, arg1) => {
const a = state0.a; const a = state0.a;
state0.a = 0; state0.a = 0;
try { try {
return __wbg_adapter_69(a, state0.b, arg0, arg1); return __wbg_adapter_83(a, state0.b, arg0, arg1);
} finally { } finally {
state0.a = a; state0.a = a;
} }
@ -534,46 +603,46 @@ function getImports() {
state0.a = state0.b = 0; 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)); const ret = Promise.resolve(getObject(arg0));
return addHeapObject(ret); 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)); const ret = getObject(arg0).then(getObject(arg1));
return addHeapObject(ret); 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)); const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
return addHeapObject(ret); return addHeapObject(ret);
}; };
imports.wbg.__wbg_buffer_3f3d764d4747d564 = function(arg0) { imports.wbg.__wbg_buffer_dbc8aa65574f18f0 = function(arg0) {
const ret = getObject(arg0).buffer; const ret = getObject(arg0).buffer;
return addHeapObject(ret); 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); const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
return addHeapObject(ret); return addHeapObject(ret);
}; };
imports.wbg.__wbg_new_8c3f0052272a457a = function(arg0) { imports.wbg.__wbg_new_397df785177a4c42 = function(arg0) {
const ret = new Uint8Array(getObject(arg0)); const ret = new Uint8Array(getObject(arg0));
return addHeapObject(ret); 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)); const ret = Reflect.get(getObject(arg0), getObject(arg1));
return addHeapObject(ret); return addHeapObject(ret);
}, arguments) }; }, 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)); const ret = Reflect.has(getObject(arg0), getObject(arg1));
return ret; return ret;
}, arguments) }; }, 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)); const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
return ret; return ret;
}, arguments) }; }, 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) { imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
const ret = debugString(getObject(arg1)); const ret = debugString(getObject(arg1));
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@ -588,8 +657,8 @@ function getImports() {
const ret = wasm.memory; const ret = wasm.memory;
return addHeapObject(ret); return addHeapObject(ret);
}; };
imports.wbg.__wbindgen_closure_wrapper929 = function(arg0, arg1, arg2) { imports.wbg.__wbindgen_closure_wrapper2246 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 143, __wbg_adapter_24); const ret = makeMutClosure(arg0, arg1, 285, __wbg_adapter_24);
return addHeapObject(ret); return addHeapObject(ret);
}; };
@ -603,6 +672,7 @@ function initMemory(imports, maybe_memory) {
function finalizeInit(instance, module) { function finalizeInit(instance, module) {
wasm = instance.exports; wasm = instance.exports;
init.__wbindgen_wasm_module = module; init.__wbindgen_wasm_module = module;
cachedFloat64Memory0 = new Float64Array();
cachedInt32Memory0 = new Int32Array(); cachedInt32Memory0 = new Int32Array();
cachedUint8Memory0 = new Uint8Array(); cachedUint8Memory0 = new Uint8Array();
@ -626,7 +696,7 @@ function initSync(module) {
async function init(input) { async function init(input) {
if (typeof input === 'undefined') { 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(); const imports = getImports();

BIN
apps/gipy/pkg/gps_bg.wasm Normal file

Binary file not shown.

18
apps/gipy/pkg/gps_bg.wasm.d.ts vendored Normal file
View File

@ -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;

View File

@ -1,12 +1,12 @@
{ {
"name": "gpconv", "name": "gps",
"version": "0.1.0", "version": "0.1.0",
"files": [ "files": [
"gpconv_bg.wasm", "gps_bg.wasm",
"gpconv.js", "gps.js",
"gpconv.d.ts" "gps.d.ts"
], ],
"module": "gpconv.js", "module": "gps.js",
"types": "gpconv.d.ts", "types": "gps.d.ts",
"sideEffects": false "sideEffects": false
} }

View File

@ -3,8 +3,7 @@
// Load settings // Load settings
var settings = Object.assign( var settings = Object.assign(
{ {
keep_gps_alive: false, lost_distance: 50,
max_speed: 35,
}, },
require("Storage").readJSON(FILE, true) || {} require("Storage").readJSON(FILE, true) || {}
); );
@ -19,7 +18,8 @@
"< Back": () => back(), "< Back": () => back(),
"keep gps alive": { "keep gps alive": {
value: !!settings.keep_gps_alive, // !! converts undefined to false value: !!settings.keep_gps_alive, // !! converts undefined to false
onchange: v => { format: (v) => (v ? "Yes" : "No"),
onchange: (v) => {
settings.keep_gps_alive = v; settings.keep_gps_alive = v;
writeSettings(); writeSettings();
}, },