node-red-contrib-jwht-map/worldmap/leaflet/leaflet-geoman.min.js

1 line
268 KiB
JavaScript
Raw Normal View History

(()=>{var t={9705:(t,e,i)=>{"use strict";var n=i(1540);function r(t){var e=[Infinity,Infinity,-Infinity,-Infinity];return n.coordEach(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e}r["default"]=r,e.Z=r},4102:(t,e)=>{"use strict";function i(t,e,i){void 0===i&&(i={});var n={type:"Feature"};return(0===i.id||i.id)&&(n.id=i.id),i.bbox&&(n.bbox=i.bbox),n.properties=e||{},n.geometry=t,n}function n(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!d(t[0])||!d(t[1]))throw new Error("coordinates must contain numbers");return i({type:"Point",coordinates:t},e,n)}function r(t,e,n){void 0===n&&(n={});for(var r=0,a=t;r<a.length;r++){var o=a[r];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}return i({type:"Polygon",coordinates:t},e,n)}function a(t,e,n){if(void 0===n&&(n={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return i({type:"LineString",coordinates:t},e,n)}function o(t,e){void 0===e&&(e={});var i={type:"FeatureCollection"};return e.id&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.features=t,i}function s(t,e,n){return void 0===n&&(n={}),i({type:"MultiLineString",coordinates:t},e,n)}function l(t,e,n){return void 0===n&&(n={}),i({type:"MultiPoint",coordinates:t},e,n)}function h(t,e,n){return void 0===n&&(n={}),i({type:"MultiPolygon",coordinates:t},e,n)}function u(t,i){void 0===i&&(i="kilometers");var n=e.factors[i];if(!n)throw new Error(i+" units is invalid");return t*n}function c(t,i){void 0===i&&(i="kilometers");var n=e.factors[i];if(!n)throw new Error(i+" units is invalid");return t/n}function p(t){return 180*(t%(2*Math.PI))/Math.PI}function d(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.earthRadius=6371008.8,e.factors={centimeters:100*e.earthRadius,centimetres:100*e.earthRadius,degrees:e.earthRadius/111325,feet:3.28084*e.earthRadius,inches:39.37*e.earthRadius,kilometers:e.earthRadius/1e3,kilometres:e.earthRadius/1e3,meters:e.earthRadius,metres:e.earthRadius,miles:e.earthRadius/1609.344,millimeters:1e3*e.earthRadius,millimetres:1e3*e.earthRadius,nauticalmiles:e.earthRadius/1852,radians:1,yards:1.0936*e.earthRadius},e.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/e.earthRadius,yards:1.0936133},e.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},e.feature=i,e.geometry=function(t,e,i){switch(void 0===i&&(i={}),t){case"Point":return n(e).geometry;case"LineString":return a(e).geometry;case"Polygon":return r(e).geometry;case"MultiPoint":return l(e).geometry;case"MultiLineString":return s(e).geometry;case"MultiPolygon":return h(e).geometry;default:throw new Error(t+" is invalid")}},e.point=n,e.points=function(t,e,i){return void 0===i&&(i={}),o(t.map((function(t){return n(t,e)})),i)},e.polygon=r,e.polygons=function(t,e,i){return void 0===i&&(i={}),o(t.map((function(t){return r(t,e)})),i)},e.lineString=a,e.lineStrings=function(t,e,i){return void 0===i&&(i={}),o(t.map((function(t){return a(t,e)})),i)},e.featureCollection=o,e.multiLineString=s,e.multiPoint=l,e.multiPolygon=h,e.geometryCollection=function(t,e,n){return void 0===n&&(n={}),i({type:"GeometryCollection",geometries:t},e,n)},e.round=function(t,e){if(void 0===e&&(e=0),e&&!(e>=0))throw new Error("precision must be a positive number");var i=Math.pow(10,e||0);return Math.round(t*i)/i},e.radiansToLength=u,e.lengthToRadians=c,e.lengthToDegrees=