@defra/interactive-map 0.0.7-alpha → 0.0.8-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/templates/map.njk +2 -2
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
- package/plugins/beta/datasets/dist/esm/index.js +1 -1
- package/plugins/beta/draw-es/dist/esm/index.js +1 -1
- package/plugins/beta/draw-ml/dist/esm/index.js +1 -1
- package/plugins/beta/frame/dist/esm/index.js +1 -1
- package/plugins/beta/map-styles/dist/esm/index.js +1 -1
- package/plugins/beta/scale-bar/dist/esm/index.js +1 -1
- package/plugins/beta/use-location/dist/esm/index.js +1 -1
- package/plugins/interact/dist/esm/index.js +1 -1
- package/plugins/search/dist/esm/index.js +1 -1
- package/providers/beta/esri/dist/esm/index.js +1 -1
- package/providers/beta/open-names/dist/esm/index.js +1 -1
- package/providers/maplibre/dist/esm/index.js +1 -1
- package/providers/maplibre/dist/esm/index.js.LICENSE.txt +5 -0
- package/webpack.esm.mjs +2 -1
- package/webpack.umd.mjs +0 -1
- package/dist/esm/im-core.js +0 -2
- package/dist/esm/im-core.js.LICENSE.txt +0 -1
- package/plugins/beta/datasets/dist/esm/im-datasets-plugin.js +0 -2
- package/plugins/beta/datasets/dist/esm/im-datasets-plugin.js.LICENSE.txt +0 -1
- package/plugins/beta/draw-es/dist/esm/im-draw-es-plugin.js +0 -2
- package/plugins/beta/draw-es/dist/esm/im-draw-es-plugin.js.LICENSE.txt +0 -1
- package/plugins/beta/draw-ml/dist/esm/im-draw-ml-plugin.js +0 -1
- package/plugins/beta/frame/dist/esm/im-frame-plugin.js +0 -1
- package/plugins/beta/map-styles/dist/esm/im-map-styles-plugin.js +0 -1
- package/plugins/beta/scale-bar/dist/esm/im-scale-bar-plugin.js +0 -1
- package/plugins/beta/use-location/dist/esm/im-use-location-plugin.js +0 -1
- package/plugins/interact/dist/esm/im-interact-plugin.js +0 -1
- package/plugins/search/dist/esm/im-search-plugin.js +0 -2
- package/plugins/search/dist/esm/im-search-plugin.js.LICENSE.txt +0 -1
- package/providers/beta/esri/dist/esm/im-esri-provider.js +0 -2
- package/providers/beta/esri/dist/esm/im-esri-provider.js.LICENSE.txt +0 -1
- package/providers/beta/open-names/dist/esm/im-reverse-geocode.js +0 -2
- package/providers/beta/open-names/dist/esm/im-reverse-geocode.js.LICENSE.txt +0 -1
- package/providers/maplibre/dist/esm/im-maplibre-framework.js +0 -2
- package/providers/maplibre/dist/esm/im-maplibre-framework.js.LICENSE.txt +0 -4
- package/providers/maplibre/dist/esm/im-maplibre-provider.js +0 -2
- package/providers/maplibre/dist/esm/im-maplibre-provider.js.LICENSE.txt +0 -1
- /package/providers/beta/esri/dist/css/{im-esri-provider.css → index.css} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
var e,r,t={},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,t)=>(n.f[t](e,r),r),[])),n.u=e=>"../esm/"+e+".js",n.miniCssF=e=>{},n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;if("string"==typeof import.meta.url&&(e=import.meta.url),!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e+"../css/"})(),e={index:0},r=r=>{var t,o,{__webpack_esm_ids__:i,__webpack_esm_modules__:c,__webpack_esm_runtime__:u}=r,a=0;for(t in c)n.o(c,t)&&(n.m[t]=c[t]);for(u&&u(n);a<i.length;a++)o=i[a],n.o(e,o)&&e[o]&&e[o][0](),e[i[a]]=0},n.f.j=(t,o)=>{var i=n.o(e,t)?e[t]:void 0;if(0!==i)if(i)o.push(i[1]);else{var c=import("../css/"+n.u(t)).then(r,r=>{throw 0!==e[t]&&(e[t]=void 0),r});c=Promise.race([c,new Promise(r=>i=e[t]=[r])]),o.push(i[1]=c)}};var i={};function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function u(){var e,r,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.toStringTag||"@@toStringTag";function i(t,o,n,i){var u=o&&o.prototype instanceof f?o:f,p=Object.create(u.prototype);return a(p,"_invoke",function(t,o,n){var i,u,a,f=0,p=n||[],s=!1,l={p:0,n:0,v:e,a:b,f:b.bind(e,4),d:function(r,t){return i=r,u=0,a=e,l.n=t,c}};function b(t,o){for(u=t,a=o,r=0;!s&&f&&!n&&r<p.length;r++){var n,i=p[r],b=l.p,y=i[2];t>3?(n=y===o)&&(a=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=b&&((n=t<2&&b<i[1])?(u=0,l.v=o,l.n=i[1]):b<y&&(n=t<3||i[0]>o||o>y)&&(i[4]=t,i[5]=o,l.n=y,u=0))}if(n||t>1)return c;throw s=!0,o}return function(n,p,y){if(f>1)throw TypeError("Generator is already running");for(s&&1===p&&b(p,y),u=p,a=y;(r=u<2?e:a)||!s;){i||(u?u<3?(u>1&&(l.n=-1),b(u,a)):l.n=a:l.v=a);try{if(f=2,i){if(u||(n="next"),r=i[n]){if(!(r=r.call(i,a)))throw TypeError("iterator result is not an object");if(!r.done)return r;a=r.value,u<2&&(u=0)}else 1===u&&(r=i.return)&&r.call(i),u<2&&(a=TypeError("The iterator does not provide a '"+n+"' method"),u=1);i=e}else if((r=(s=l.n<0)?a:t.call(o,l))!==c)break}catch(r){i=e,u=1,a=r}finally{f=1}}return{value:r,done:s}}}(t,n,i),!0),p}var c={};function f(){}function p(){}function s(){}r=Object.getPrototypeOf;var l=[][o]?r(r([][o]())):(a(r={},o,function(){return this}),r),b=s.prototype=f.prototype=Object.create(l);function y(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,a(e,n,"GeneratorFunction")),e.prototype=Object.create(b),e}return p.prototype=s,a(b,"constructor",s),a(s,"constructor",p),p.displayName="GeneratorFunction",a(s,n,"GeneratorFunction"),a(b),a(b,n,"Generator"),a(b,o,function(){return this}),a(b,"toString",function(){return"[object Generator]"}),(u=function(){return{w:i,m:y}})()}function a(e,r,t,o){var n=Object.defineProperty;try{n({},"",{})}catch(e){n=0}a=function(e,r,t,o){function i(r,t){a(e,r,function(e){return this._invoke(r,t,e)})}r?n?n(e,r,{value:t,enumerable:!o,configurable:!o,writable:!o}):e[r]=t:(i("next",0),i("throw",1),i("return",2))},a(e,r,t,o)}function f(e,r,t,o,n,i,c){try{var u=e[i](c),a=u.value}catch(e){return void t(e)}u.done?r(a):Promise.resolve(a).then(o,n)}function p(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function s(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?p(Object(t),!0).forEach(function(r){l(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):p(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function l(e,r,t){return(r=function(e){var r=function(e){if("object"!=c(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var t=r.call(e,"string");if("object"!=c(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==c(r)?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function b(){var e,r;return s(s({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{load:(e=u().m(function e(){var r;return u().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,n.e("im-reverse-geocode").then(n.bind(n,"./providers/beta/open-names/src/reverseGeocode.js"));case 1:return r=e.v,e.a(2,r.reverseGeocode)}},e)}),r=function(){var r=this,t=arguments;return new Promise(function(o,n){var i=e.apply(r,t);function c(e){f(i,o,n,c,u,"next",e)}function u(e){f(i,o,n,c,u,"throw",e)}c(void 0)})},function(){return r.apply(this,arguments)})})}n.d(i,{A:()=>b});const y=i.A;export{y as default};
|
|
2
|
+
var t={"./providers/beta/open-names/src/reverseGeocode.js"(t,e,r){r.d(e,{reverseGeocode:()=>S}),r.r(e);let n=" ";class o{static get separator(){return n}static set separator(t){n=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);const e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let r=null;switch(e.length){case 3:r=e[0]/1+e[1]/60+e[2]/3600;break;case 2:r=e[0]/1+e[1]/60;break;case 1:r=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(r=-r),Number(r)}static toDms(t,e="d",r=void 0){if(isNaN(t))return null;if("string"==typeof t&&""==t.trim())return null;if("boolean"==typeof t)return null;if(t==1/0)return null;if(null==t)return null;if(void 0===r)switch(e){case"d":case"deg":r=4;break;case"dm":case"deg+min":r=2;break;case"dms":case"deg+min+sec":r=0;break;default:e="d",r=4}t=Math.abs(t);let n=null,i=null,a=null,s=null;switch(e){default:case"d":case"deg":i=t.toFixed(r),i<100&&(i="0"+i),i<10&&(i="0"+i),n=i+"°";break;case"dm":case"deg+min":i=Math.floor(t),a=(60*t%60).toFixed(r),60==a&&(a=(0).toFixed(r),i++),i=("000"+i).slice(-3),a<10&&(a="0"+a),n=i+"°"+o.separator+a+"′";break;case"dms":case"deg+min+sec":i=Math.floor(t),a=Math.floor(3600*t/60)%60,s=(3600*t%60).toFixed(r),60==s&&(s=(0).toFixed(r),a++),60==a&&(a=0,i++),i=("000"+i).slice(-3),a=("00"+a).slice(-2),s<10&&(s="0"+s),n=i+"°"+o.separator+a+"′"+o.separator+s+"″"}return n}static toLat(t,e,r){const n=o.toDms(o.wrap90(t),e,r);return null===n?"–":n.slice(1)+o.separator+(t<0?"S":"N")}static toLon(t,e,r){const n=o.toDms(o.wrap180(t),e,r);return null===n?"–":n+o.separator+(t<0?"W":"E")}static toBrng(t,e,r){const n=o.toDms(o.wrap360(t),e,r);return null===n?"–":n.replace("360","0")}static fromLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(r.thousands,"⁜").replace(r.decimal,".").replace("⁜",",")}static toLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",r.decimal).replace("⁜",r.thousands)}static compassPoint(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=o.wrap360(t);const r=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*r/360)%r*16/r]}static wrap90(t){if(-90<=t&&t<=90)return t;const e=t;return 1*Math.abs(((e-90)%360+360)%360-180)-90}static wrap180(t){if(-180<=t&&t<=180)return t;const e=360;return((360*t/e-180)%e+e)%e-180}static wrap360(t){if(0<=t&&t<360)return t;const e=360;return(360*t/e%e+e)%e}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const i=o;class a{constructor(t,e,r){if(isNaN(t)||isNaN(e)||isNaN(r))throw new TypeError(`invalid vector [${t},${e},${r}]`);this.x=Number(t),this.y=Number(e),this.z=Number(r)}get length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}plus(t){if(!(t instanceof a))throw new TypeError("v is not Vector3d object");return new a(this.x+t.x,this.y+t.y,this.z+t.z)}minus(t){if(!(t instanceof a))throw new TypeError("v is not Vector3d object");return new a(this.x-t.x,this.y-t.y,this.z-t.z)}times(t){if(isNaN(t))throw new TypeError(`invalid scalar value ‘${t}’`);return new a(this.x*t,this.y*t,this.z*t)}dividedBy(t){if(isNaN(t))throw new TypeError(`invalid scalar value ‘${t}’`);return new a(this.x/t,this.y/t,this.z/t)}dot(t){if(!(t instanceof a))throw new TypeError("v is not Vector3d object");return this.x*t.x+this.y*t.y+this.z*t.z}cross(t){if(!(t instanceof a))throw new TypeError("v is not Vector3d object");const e=this.y*t.z-this.z*t.y,r=this.z*t.x-this.x*t.z,n=this.x*t.y-this.y*t.x;return new a(e,r,n)}negate(){return new a(-this.x,-this.y,-this.z)}unit(){const t=this.length;if(1==t)return this;if(0==t)return this;const e=this.x/t,r=this.y/t,n=this.z/t;return new a(e,r,n)}angleTo(t,e=void 0){if(!(t instanceof a))throw new TypeError("v is not Vector3d object");if(!(e instanceof a||null==e))throw new TypeError("n is not Vector3d object");const r=null==e||this.cross(t).dot(e)>=0?1:-1,n=this.cross(t).length*r,o=this.dot(t);return Math.atan2(n,o)}rotateAround(t,e){if(!(t instanceof a))throw new TypeError("axis is not Vector3d object");const r=e.toRadians(),n=this.unit(),o=t.unit(),i=Math.sin(r),s=Math.cos(r),l=1-s,c=o.x,u=o.y,h=o.z,p=[[l*c*c+s,l*c*u-i*h,l*c*h+i*u],[l*c*u+i*h,l*u*u+s,l*u*h-i*c],[l*c*h-i*u,l*u*h+i*c,l*h*h+s]],d=[p[0][0]*n.x+p[0][1]*n.y+p[0][2]*n.z,p[1][0]*n.x+p[1][1]*n.y+p[1][2]*n.z,p[2][0]*n.x+p[2][1]*n.y+p[2][2]*n.z];return new a(d[0],d[1],d[2])}toString(t=3){return`[${this.x.toFixed(t)},${this.y.toFixed(t)},${this.z.toFixed(t)}]`}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const s=a,l={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563}},c={WGS84:{ellipsoid:l.WGS84}};Object.freeze(l.WGS84),Object.freeze(c.WGS84);class u{constructor(t,e,r=0){if(isNaN(t)||null==t)throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e)||null==e)throw new TypeError(`invalid lon ‘${e}’`);if(isNaN(r)||null==r)throw new TypeError(`invalid height ‘${r}’`);this._lat=i.wrap90(Number(t)),this._lon=i.wrap180(Number(e)),this._height=Number(r)}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?i.wrap90(i.parse(t)):i.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?i.wrap90(i.parse(t)):i.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?i.wrap180(i.parse(t)):i.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?i.wrap180(i.parse(t)):i.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?i.wrap180(i.parse(t)):i.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}get height(){return this._height}set height(t){if(this._height=Number(t),isNaN(this._height))throw new TypeError(`invalid height ‘${t}’`)}get datum(){return this._datum}set datum(t){this._datum=t}static get ellipsoids(){return l}static get datums(){return c}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");let e,r,n;if("object"==typeof t[0]&&(1==t.length||!isNaN(parseFloat(t[1])))){const o=t[0];if("Point"==o.type&&Array.isArray(o.coordinates)?([r,e,n]=o.coordinates,n=n||0):(null!=o.latitude&&(e=o.latitude),null!=o.lat&&(e=o.lat),null!=o.longitude&&(r=o.longitude),null!=o.lng&&(r=o.lng),null!=o.lon&&(r=o.lon),null!=o.height&&(n=o.height),e=i.wrap90(i.parse(e)),r=i.wrap180(i.parse(r))),null!=t[1]&&(n=t[1]),isNaN(e)||isNaN(r))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if("string"==typeof t[0]&&2==t[0].split(",").length&&([e,r]=t[0].split(","),e=i.wrap90(i.parse(e)),r=i.wrap180(i.parse(r)),n=t[1]||0,isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t[0]}’`);if(null==e&&null==r&&([e,r]=t,e=i.wrap90(i.parse(e)),r=i.wrap180(i.parse(r)),n=t[2]||0,isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t.toString()}’`);return new this(e,r,n)}toCartesian(){const t=this.datum?this.datum.ellipsoid:this.referenceFrame?this.referenceFrame.ellipsoid:l.WGS84,e=this.lat.toRadians(),r=this.lon.toRadians(),n=this.height,{a:o,f:i}=t,a=Math.sin(e),s=Math.cos(e),c=Math.sin(r),u=Math.cos(r),p=2*i-i*i,d=o/Math.sqrt(1-p*a*a);return new h((d+n)*s*u,(d+n)*s*c,(d*(1-p)+n)*a)}equals(t){if(!(t instanceof u))throw new TypeError(`invalid point ‘${t}’`);return!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.lon)>Number.EPSILON||Math.abs(this.height-t.height)>Number.EPSILON||this.datum!=t.datum||this.referenceFrame!=t.referenceFrame||this.epoch!=t.epoch)}toString(t="d",e=void 0,r=null){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);const n=(this.height>=0?" +":" ")+this.height.toFixed(r)+"m";return"n"==t?(null==e&&(e=4),`${this.lat.toFixed(e)}, ${this.lon.toFixed(e)}${null==r?"":n}`):`${i.toLat(this.lat,t,e)}, ${i.toLon(this.lon,t,e)}${null==r?"":n}`}}class h extends s{constructor(t,e,r){super(t,e,r)}toLatLon(t=l.WGS84){if(!t||!t.a)throw new TypeError(`invalid ellipsoid ‘${t}’`);const{x:e,y:r,z:n}=this,{a:o,b:i,f:a}=t,s=2*a-a*a,c=s/(1-s),h=Math.sqrt(e*e+r*r),p=i*n/(o*h)*(1+c*i/Math.sqrt(h*h+n*n)),d=p/Math.sqrt(1+p*p),f=d/p,y=isNaN(f)?0:Math.atan2(n+c*i*d*d*d,h-s*o*f*f*f),m=Math.atan2(r,e),g=Math.sin(y),w=h*Math.cos(y)+n*g-o*o/(o/Math.sqrt(1-s*g*g));return new u(y.toDegrees(),m.toDegrees(),w)}toString(t=0){return`[${this.x.toFixed(t)},${this.y.toFixed(t)},${this.z.toFixed(t)}]`}}const p={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563},Airy1830:{a:6377563.396,b:6356256.909,f:1/299.3249646},AiryModified:{a:6377340.189,b:6356034.448,f:1/299.3249646},Bessel1841:{a:6377397.155,b:6356078.962818,f:1/299.1528128},Clarke1866:{a:6378206.4,b:6356583.8,f:1/294.978698214},Clarke1880IGN:{a:6378249.2,b:6356515,f:1/293.466021294},GRS80:{a:6378137,b:6356752.31414,f:1/298.257222101},Intl1924:{a:6378388,b:6356911.946,f:1/297},WGS72:{a:6378135,b:6356750.5,f:1/298.26}},d={ED50:{ellipsoid:p.Intl1924,transform:[89.5,93.8,123.1,-1.2,0,0,.156]},ETRS89:{ellipsoid:p.GRS80,transform:[0,0,0,0,0,0,0]},Irl1975:{ellipsoid:p.AiryModified,transform:[-482.53,130.596,-564.557,-8.15,1.042,.214,.631]},NAD27:{ellipsoid:p.Clarke1866,transform:[8,-160,-176,0,0,0,0]},NAD83:{ellipsoid:p.GRS80,transform:[.9956,-1.9103,-.5215,-62e-5,.025915,.009426,.011599]},NTF:{ellipsoid:p.Clarke1880IGN,transform:[168,60,-320,0,0,0,0]},OSGB36:{ellipsoid:p.Airy1830,transform:[-446.448,125.157,-542.06,20.4894,-.1502,-.247,-.8421]},Potsdam:{ellipsoid:p.Bessel1841,transform:[-582,-105,-414,-8.3,1.04,.35,-3.08]},TokyoJapan:{ellipsoid:p.Bessel1841,transform:[148,-507,-685,0,0,0,0]},WGS72:{ellipsoid:p.WGS72,transform:[0,0,-4.5,-.22,0,0,.554]},WGS84:{ellipsoid:p.WGS84,transform:[0,0,0,0,0,0,0]}};Object.keys(p).forEach(t=>Object.freeze(p[t])),Object.keys(d).forEach(t=>{Object.freeze(d[t]),Object.freeze(d[t].transform)});class f extends u{constructor(t,e,r=0,n=d.WGS84){if(!n||null==n.ellipsoid)throw new TypeError(`unrecognised datum ‘${n}’`);super(t,e,r),this._datum=n}get datum(){return this._datum}static get ellipsoids(){return p}static get datums(){return d}static parse(...t){let e=d.WGS84;if((4==t.length||3==t.length&&"object"==typeof t[2])&&(e=t.pop()),!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);const r=super.parse(...t);return r._datum=e,r}convertDatum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);return this.toCartesian().convertDatum(t).toLatLon()}toCartesian(){const t=super.toCartesian();return new y(t.x,t.y,t.z,this.datum)}}class y extends h{constructor(t,e,r,n=void 0){if(n&&null==n.ellipsoid)throw new TypeError(`unrecognised datum ‘${n}’`);super(t,e,r),n&&(this._datum=n)}get datum(){return this._datum}set datum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);this._datum=t}toLatLon(t=void 0){t&&(console.info("datum parameter to Cartesian_Datum.toLatLon is deprecated: set datum before calling toLatLon()"),this.datum=t);const e=this.datum||d.WGS84;if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);const r=super.toLatLon(e.ellipsoid);return new f(r.lat,r.lon,r.height,this.datum)}convertDatum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);if(!this.datum)throw new TypeError("cartesian coordinate has no datum");let e=null,r=null;null!=this.datum&&this.datum!=d.WGS84||(e=this,r=t.transform),t==d.WGS84&&(e=this,r=this.datum.transform.map(t=>-t)),null==r&&(e=this.convertDatum(d.WGS84),r=t.transform);const n=e.applyTransform(r);return n.datum=t,n}applyTransform(t){const{x:e,y:r,z:n}=this,o=t[0],i=t[1],a=t[2],s=t[3]/1e6+1,l=(t[4]/3600).toRadians(),c=(t[5]/3600).toRadians(),u=(t[6]/3600).toRadians();return new y(o+e*s-r*u+n*c,i+e*u+r*s-n*l,a-e*c+r*l+n*s)}}const m={trueOrigin:{lat:49,lon:-2},falseOrigin:{easting:-4e5,northing:1e5},scaleFactor:.9996012717,ellipsoid:f.ellipsoids.Airy1830};class g{constructor(t,e){if(this.easting=Number(t),this.northing=Number(e),isNaN(t)||this.easting<0||this.easting>7e5)throw new RangeError(`invalid easting ‘${t}’`);if(isNaN(e)||this.northing<0||this.northing>13e5)throw new RangeError(`invalid northing ‘${e}’`)}toLatLon(t=f.datums.WGS84){const{easting:e,northing:r}=this,{a:n,b:o}=m.ellipsoid,i=m.trueOrigin.lat.toRadians(),a=m.trueOrigin.lon.toRadians(),s=-m.falseOrigin.easting,l=-m.falseOrigin.northing,c=m.scaleFactor,u=1-o*o/(n*n),h=(n-o)/(n+o),p=h*h,d=h*h*h;let y=i,g=0;do{y=(r-l-g)/(n*c)+y,g=o*c*((1+h+5/4*p+5/4*d)*(y-i)-(3*h+3*h*h+21/8*d)*Math.sin(y-i)*Math.cos(y+i)+(15/8*p+15/8*d)*Math.sin(2*(y-i))*Math.cos(2*(y+i))-35/24*d*Math.sin(3*(y-i))*Math.cos(3*(y+i)))}while(Math.abs(r-l-g)>=1e-5);const b=Math.cos(y),v=Math.sin(y),_=n*c/Math.sqrt(1-u*v*v),N=n*c*(1-u)/Math.pow(1-u*v*v,1.5),S=_/N-1,E=Math.tan(y),O=E*E,M=O*O,T=1/b,x=_*_*_,G=x*_*_,$=e-s,j=$*$,P=j*$,F=j*j,R=P*j;y=y-E/(2*N*_)*j+E/(24*N*x)*(5+3*O+S-9*O*S)*F-E/(720*N*G)*(61+90*O+45*M)*(F*j);const W=a+T/_*$-T/(6*x)*(_/N+2*O)*P+T/(120*G)*(5+28*O+24*M)*R-T/(G*_*_*5040)*(61+662*O+1320*M+M*O*720)*(R*j);let D=new w(y.toDegrees(),W.toDegrees(),0,f.datums.OSGB36);return t!=f.datums.OSGB36&&(D=D.convertDatum(t),D=new w(D.lat,D.lon,D.height,D.datum)),D}static parse(t){let e=(t=String(t).trim()).match(/^(\d+),\s*(\d+)$/);if(e)return new g(e[1],e[2]);if(e=t.match(/^[HNST][ABCDEFGHJKLMNOPQRSTUVWXYZ]\s*[0-9]+\s*[0-9]+$/i),!e)throw new Error(`invalid grid reference ‘${t}’`);let r=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0),n=t.toUpperCase().charCodeAt(1)-"A".charCodeAt(0);r>7&&r--,n>7&&n--;const o=(r-2)%5*5+n%5,i=19-5*Math.floor(r/5)-Math.floor(n/5);let a=t.slice(2).trim().split(/\s+/);if(1==a.length&&(a=[a[0].slice(0,a[0].length/2),a[0].slice(a[0].length/2)]),a[0].length!=a[1].length)throw new Error(`invalid grid reference ‘${t}’`);a[0]=a[0].padEnd(5,"0"),a[1]=a[1].padEnd(5,"0");const s=o+a[0],l=i+a[1];return new g(s,l)}toString(t=10){if(![0,2,4,6,8,10,12,14,16].includes(Number(t)))throw new RangeError(`invalid precision ‘${t}’`);let{easting:e,northing:r}=this;if(0==t){const t={useGrouping:!1,minimumIntegerDigits:6,maximumFractionDigits:3};return`${e.toLocaleString("en",t)},${r.toLocaleString("en",t)}`}const n=Math.floor(e/1e5),o=Math.floor(r/1e5);let i=19-o-(19-o)%5+Math.floor((n+10)/5),a=5*(19-o)%25+n%5;i>7&&i++,a>7&&a++;const s=String.fromCharCode(i+"A".charCodeAt(0),a+"A".charCodeAt(0));return e=Math.floor(e%1e5/Math.pow(10,5-t/2)),r=Math.floor(r%1e5/Math.pow(10,5-t/2)),e=e.toString().padStart(t/2,"0"),r=r.toString().padStart(t/2,"0"),`${s} ${e} ${r}`}}class w extends f{toOsGrid(){const t=this.datum==f.datums.OSGB36?this:this.convertDatum(f.datums.OSGB36),e=t.lat.toRadians(),r=t.lon.toRadians(),{a:n,b:o}=m.ellipsoid,i=m.trueOrigin.lat.toRadians(),a=m.trueOrigin.lon.toRadians(),s=-m.falseOrigin.easting,l=-m.falseOrigin.northing,c=m.scaleFactor,u=1-o*o/(n*n),h=(n-o)/(n+o),p=h*h,d=h*h*h,y=Math.cos(e),w=Math.sin(e),b=n*c/Math.sqrt(1-u*w*w),v=n*c*(1-u)/Math.pow(1-u*w*w,1.5),_=b/v-1,N=o*c*((1+h+5/4*p+5/4*d)*(e-i)-(3*h+3*h*h+21/8*d)*Math.sin(e-i)*Math.cos(e+i)+(15/8*p+15/8*d)*Math.sin(2*(e-i))*Math.cos(2*(e+i))-35/24*d*Math.sin(3*(e-i))*Math.cos(3*(e+i))),S=y*y*y,E=S*y*y,O=Math.tan(e)*Math.tan(e),M=O*O,T=r-a,x=T*T,G=x*T,$=G*T,j=$*T;let P=N+l+b/2*w*y*x+b/24*w*S*(5-O+9*_)*$+b/720*w*E*(61-58*O+M)*(j*T),F=s+b*y*T+b/6*S*(b/v-O)*G+b/120*E*(5-18*O+M+14*_-58*O*_)*j;P=Number(P.toFixed(3)),F=Number(F.toFixed(3));try{return new g(F,P)}catch(e){throw new Error(`${e.message} from (${t.lat.toFixed(6)},${t.lon.toFixed(6)}).toOsGrid()`)}}convertDatum(t){const e=super.convertDatum(t);return new w(e.lat,e.lon,e.height,e.datum)}}function b(t){var e=t.ID,r=t.NAME1,n=t.POPULATED_PLACE,o=t.COUNTY_UNITARY,i=t.REGION,a=t.GEOMETRY_X,s=t.GEOMETRY_Y;return{id:e||"",place:"".concat(r).concat(n?", "+n:"").concat(o?", "+o:"",", ").concat(i),county:o||"",coordinates:[a,s]}}function v(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return _(c,"_invoke",function(r,n,o){var i,s,l,c=0,u=o||[],h=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return i=e,s=0,l=t,p.n=r,a}};function d(r,n){for(s=r,l=n,e=0;!h&&c&&!o&&e<u.length;e++){var o,i=u[e],d=p.p,f=i[2];r>3?(o=f===n)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<f&&(o=r<3||i[0]>n||n>f)&&(i[4]=r,i[5]=n,p.n=f,s=0))}if(o||r>1)return a;throw h=!0,n}return function(o,u,f){if(c>1)throw TypeError("Generator is already running");for(h&&1===u&&d(u,f),s=u,l=f;(e=s<2?t:l)||!h;){i||(s?s<3?(s>1&&(p.n=-1),d(s,l)):p.n=l:p.v=l);try{if(c=2,i){if(s||(o="next"),e=i[o]){if(!(e=e.call(i,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,s<2&&(s=0)}else 1===s&&(e=i.return)&&e.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((e=(h=p.n<0)?l:r.call(n,p))!==a)break}catch(e){i=t,s=1,l=e}finally{c=1}}return{value:e,done:h}}}(r,o,i),!0),c}var a={};function s(){}function l(){}function c(){}e=Object.getPrototypeOf;var u=[][n]?e(e([][n]())):(_(e={},n,function(){return this}),e),h=c.prototype=s.prototype=Object.create(u);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,_(t,o,"GeneratorFunction")),t.prototype=Object.create(h),t}return l.prototype=c,_(h,"constructor",c),_(c,"constructor",l),l.displayName="GeneratorFunction",_(c,o,"GeneratorFunction"),_(h),_(h,o,"Generator"),_(h,n,function(){return this}),_(h,"toString",function(){return"[object Generator]"}),(v=function(){return{w:i,m:p}})()}function _(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}_=function(t,e,r,n){function i(e,r){_(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},_(t,e,r,n)}function N(t,e,r,n,o,i,a){try{var s=t[i](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,o)}var S=function(){var t,e=(t=v().m(function t(){var e,r,n,o,i,a,s,l,c,u,h,p,d,f,y=arguments;return v().w(function(t){for(;;)switch(t.p=t.n){case 0:if(e=y.length>0&&void 0!==y[0]?y[0]:"https://api.os.uk/search/names/v1/nearest?point={easting},{northing}&radius=1000&fq=local_type:Airfield%20local_type:Airport%20local_type:Bus_Station%20local_type:Chemical_Works%20local_type:City%20local_type:Coach_Station%20local_type:Electricity_Distribution%20local_type:Electricity_Production%20local_type:Further_Education%20local_type:Gas_Distribution_or_Storage%20local_type:Hamlet%20local_type:Harbour%20local_type:Helicopter_Station%20local_type:Heliport%20local_type:Higher_or_University_Education%20local_type:Hill_Or_Mountain%20local_type:Hospice%20local_type:Hospital%20local_type:Medical_Care_Accommodation%20local_type:Named_Road%20local_type:Non_State_Primary_Education%20local_type:Non_State_Secondary_Education%20local_type:Other_Settlement%20local_type:Passenger_Ferry_Terminal%20local_type:Port_Consisting_of_Docks_and_Nautical_Berthing%20local_type:Postcode%20local_type:Primary_Education%20local_type:Railway_Station%20local_type:Road_User_Services%20local_type:Secondary_Education%20local_type:Section_Of_Named_Road%20local_type:Section_Of_Numbered_Road%20local_type:Special_Needs_Education%20local_type:Suburban_Area%20local_type:Town%20local_type:Urban_Greenspace%20local_type:Vehicular_Ferry_Terminal%20local_type:Vehicular_Rail_Terminal%20local_type:Village%20local_type:Waterfall%20",r=y.length>1?y[1]:void 0,i=o=y.length>4?y[4]:void 0,"EPSG:4326"!==(n=y.length>2?y[2]:void 0)){t.n=3;break}t.p=1,i=[(i=new w(o[1],o[0]).toOsGrid()).easting,i.northing].map(function(t){return Math.round(t)}),t.n=3;break;case 2:return t.p=2,d=t.v,console.log(d),t.a(2,null);case 3:if(e=e.replace("{easting}",Math.round(i[0])).replace("{northing}",Math.round(i[1])),a=new Request(e,{method:"GET"}),!r){t.n=7;break}return t.p=4,t.n=5,r(a);case 5:a=t.v,t.n=7;break;case 6:return t.p=6,f=t.v,console.log("Error transforming request:",f),t.a(2,null);case 7:return t.n=8,fetch(a);case 8:return s=t.v,t.n=9,s.json();case 9:return l=t.v,c=b(l.results[0].GAZETTEER_ENTRY),"EPSG:4326"===n&&(u=new g(c.coordinates[0],c.coordinates[1]),h=u.toLatLon(),c.coordinates=[h.lat,h.lon]),p="Approximate centre ".concat(null==c?void 0:c.place),t.a(2,l.results?p:null)}},t,null,[[4,6],[1,2]])}),function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){N(i,n,o,a,s,"next",t)}function s(t){N(i,n,o,a,s,"throw",t)}a(void 0)})});return function(){return e.apply(this,arguments)}}()}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function s(r,n,o,i){var s=n&&n.prototype instanceof c?n:c,u=Object.create(s.prototype);return a(u,"_invoke",function(r,n,o){var i,a,s,c=0,u=o||[],h=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return i=e,a=0,s=t,p.n=r,l}};function d(r,n){for(a=r,s=n,e=0;!h&&c&&!o&&e<u.length;e++){var o,i=u[e],d=p.p,f=i[2];r>3?(o=f===n)&&(s=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=r<2&&d<i[1])?(a=0,p.v=n,p.n=i[1]):d<f&&(o=r<3||i[0]>n||n>f)&&(i[4]=r,i[5]=n,p.n=f,a=0))}if(o||r>1)return l;throw h=!0,n}return function(o,u,f){if(c>1)throw TypeError("Generator is already running");for(h&&1===u&&d(u,f),a=u,s=f;(e=a<2?t:s)||!h;){i||(a?a<3?(a>1&&(p.n=-1),d(a,s)):p.n=s:p.v=s);try{if(c=2,i){if(a||(o="next"),e=i[o]){if(!(e=e.call(i,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=i.return)&&e.call(i),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=t}else if((e=(h=p.n<0)?s:r.call(n,p))!==l)break}catch(e){i=t,a=1,s=e}finally{c=1}}return{value:e,done:h}}}(r,o,i),!0),u}var l={};function c(){}function u(){}function h(){}e=Object.getPrototypeOf;var p=[][n]?e(e([][n]())):(a(e={},n,function(){return this}),e),d=h.prototype=c.prototype=Object.create(p);function f(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,a(t,o,"GeneratorFunction")),t.prototype=Object.create(d),t}return u.prototype=h,a(d,"constructor",h),a(h,"constructor",u),u.displayName="GeneratorFunction",a(h,o,"GeneratorFunction"),a(d),a(d,o,"Generator"),a(d,n,function(){return this}),a(d,"toString",function(){return"[object Generator]"}),(i=function(){return{w:s,m:f}})()}function a(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}a=function(t,e,r,n){function i(e,r){a(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},a(t,e,r,n)}function s(t,e,r,n,o,i,a){try{var s=t[i](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,o)}function l(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function c(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?l(Object(r),!0).forEach(function(e){u(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function u(t,e,r){return(e=function(t){var e=function(t){if("object"!=o(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==o(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(){var t,e;return c(c({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{load:(t=i().m(function t(){var e;return i().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,Promise.resolve().then(r.bind(r,"./providers/beta/open-names/src/reverseGeocode.js"));case 1:return e=t.v,t.a(2,e.reverseGeocode)}},t)}),e=function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){s(i,n,o,a,l,"next",t)}function l(t){s(i,n,o,a,l,"throw",t)}a(void 0)})},function(){return e.apply(this,arguments)})})}r.d(n,{A:()=>h});const p=n.A;export{p as default};
|