dawarich/vendor/javascript/maplibre-gl.js

9 lines
987 KiB
JavaScript
Raw Normal View History

0.36.2 (#2007) * fix: move foreman to global gems to fix startup crash (#1971) * Update exporting code to stream points data to file in batches to red… (#1980) * Update exporting code to stream points data to file in batches to reduce memory usage * Update changelog * Update changelog * Feature/maplibre frontend (#1953) * Add a plan to use MapLibre GL JS for the frontend map rendering, replacing Leaflet * Implement phase 1 * Phases 1-3 + part of 4 * Fix e2e tests * Phase 6 * Implement fog of war * Phase 7 * Next step: fix specs, phase 7 done * Use our own map tiles * Extract v2 map logic to separate manager classes * Update settings panel on v2 map * Update v2 e2e tests structure * Reimplement location search in maps v2 * Update speed routes * Implement visits and places creation in v2 * Fix last failing test * Implement visits merging * Fix a routes e2e test and simplify the routes layer styling. * Extract js to modules from maps_v2_controller.js * Implement area creation * Fix spec problem * Fix some e2e tests * Implement live mode in v2 map * Update icons and panel * Extract some styles * Remove unused file * Start adding dark theme to popups on MapLibre maps * Make popups respect dark theme * Move v2 maps to maplibre namespace * Update v2 references to maplibre * Put place, area and visit info into side panel * Update API to use safe settings config method * Fix specs * Fix method name to config in SafeSettings and update usages accordingly * Add missing public files * Add handling for real time points * Fix remembering enabled/disabled layers of the v2 map * Fix lots of e2e tests * Add settings to select map version * Use maps/v2 as main path for MapLibre maps * Update routing * Update live mode * Update maplibre controller * Update changelog * Remove some console.log statements --------- Co-authored-by: Robin Tuszik <mail@robin.gg>
2025-12-06 14:54:49 -05:00
// maplibre-gl@5.12.0 downloaded from https://ga.jspm.io/npm:maplibre-gl@5.12.0/dist/maplibre-gl.js
var e=typeof globalThis!=="undefined"?globalThis:typeof self!=="undefined"?self:global;var s={};
/**
* MapLibre GL JS
* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v5.12.0/LICENSE.txt
*/(function(e,a){s=a()})(0,(function(){var s={};var a={};function l(e,l,c){a[e]=c;if(e==="index"){var u="var sharedModule = {}; ("+a.shared+")(sharedModule); ("+a.worker+")(sharedModule);";var d={};a.shared(d);a.index(s,d);typeof window!=="undefined"&&s.setWorkerUrl(window.URL.createObjectURL(new Blob([u],{type:"text/javascript"})));return s}}l("shared",["exports"],(function(s){function a(e,s,a,l){return new(a||(a=Promise))((function(c,u){function d(e){try{_(l.next(e))}catch(e){u(e)}}function f(e){try{_(l.throw(e))}catch(e){u(e)}}function _(e){var s;e.done?c(e.value):(s=e.value,s instanceof a?s:new a((function(e){e(s)}))).then(d,f)}_((l=l.apply(e,s||[])).next())}))}function l(s,a){(this||e).x=s,(this||e).y=a}function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var u,d;"function"==typeof SuppressedError&&SuppressedError,l.prototype={clone(){return new l((this||e).x,(this||e).y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,s){return this.clone()._rotateAround(e,s)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt((this||e).x*(this||e).x+(this||e).y*(this||e).y)},equals(s){return(this||e).x===s.x&&(this||e).y===s.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(s){const a=s.x-(this||e).x,l=s.y-(this||e).y;return a*a+l*l},angle(){return Math.atan2((this||e).y,(this||e).x)},angleTo(s){return Math.atan2((this||e).y-s.y,(this||e).x-s.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(s,a){return Math.atan2((this||e).x*a-(this||e).y*s,(this||e).x*s+(this||e).y*a)},_matMult(s){const a=s[2]*(this||e).x+s[3]*(this||e).y;return(this||e).x=s[0]*(this||e).x+s[1]*(this||e).y,(this||e).y=a,this||e},_add(s){return(this||e).x+=s.x,(this||e).y+=s.y,this||e},_sub(s){return(this||e).x-=s.x,(this||e).y-=s.y,this||e},_mult(s){return(this||e).x*=s,(this||e).y*=s,this||e},_div(s){return(this||e).x/=s,(this||e).y/=s,this||e},_multByPoint(s){return(this||e).x*=s.x,(this||e).y*=s.y,this||e},_divByPoint(s){return(this||e).x/=s.x,(this||e).y/=s.y,this||e},_unit(){return this._div(this.mag()),this||e},_perp(){const s=(this||e).y;return(this||e).y=(this||e).x,(this||e).x=-s,this||e},_rotate(s){const a=Math.cos(s),l=Math.sin(s),c=l*(this||e).x+a*(this||e).y;return(this||e).x=a*(this||e).x-l*(this||e).y,(this||e).y=c,this||e},_rotateAround(s,a){const l=Math.cos(s),c=Math.sin(s),u=a.y+c*((this||e).x-a.x)+l*((this||e).y-a.y);return(this||e).x=a.x+l*((this||e).x-a.x)-c*((this||e).y-a.y),(this||e).y=u,this||e},_round(){return(this||e).x=Math.round((this||e).x),(this||e).y=Math.round((this||e).y),this||e},constructor:l},l.convert=function(e){if(e instanceof l)return e;if(Array.isArray(e))return new l(+e[0],+e[1]);if(void 0!==e.x&&void 0!==e.y)return new l(+e.x,+e.y);throw new Error("Expected [x, y] or {x, y} point format")};var f=function(){if(d)return u;function s(s,a,l,c){(this||e).cx=3*s,(this||e).bx=3*(l-s)-(this||e).cx,(this||e).ax=1-(this||e).cx-(this||e).bx,(this||e).cy=3*a,(this||e).by=3*(c-a)-(this||e).cy,(this||e).ay=1-(this||e).cy-(this||e).by,(this||e).p1x=s,(this||e).p1y=a,(this||e).p2x=l,(this||e).p2y=c}return d=1,u=s,s.prototype={sampleCurveX:function(s){return(((this||e).ax*s+(this||e).bx)*s+(this||e).cx)*s},sampleCurveY:function(s){return(((this||e).ay*s+(this||e).by)*s+(this||e).cy)*s},sampleCurveDerivativeX:function(s){return(3*(this||e).ax*s+2*(this||e).bx)*s+(this||e).cx},solveCurveX:function(e,s){if(void 0===s&&(s=1e-6),e<0)return 0;if(e>1)return 1;for(var a=e,l=0;l<8;l++){var c=this.sampleCurveX(a)-e;if(Math.abs(c)<s)return a;var u=this.sampleCurveDerivativeX(a);if(Math.abs(u)<1e-6)break;a-=c/u}var d=0,f=1;for(a=e,l=0;l<20&&(c=this.sampleCurveX(a),!(Math.abs(c-e)<s));l++)e>c?d=a:f=a,a=.5*