mirror of
https://github.com/netzmacht/contao-leaflet-libraries.git
synced 2025-11-28 19:13:54 +01:00
1 line
389 KiB
JavaScript
1 line
389 KiB
JavaScript
|
|
!function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t["default"]}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=8)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=void 0;var i=function(t){return t&&t.__esModule?t:{"default":t}}(n(5)),r=L.Class.extend({includes:[i["default"]],options:{snappable:!0,snapDistance:20,cursorMarker:!0,finishOnDoubleClick:!1,finishOn:null,allowSelfIntersection:!0,templineStyle:{},hintlineStyle:{dashArray:[5,5]},markerStyle:{draggable:!0}},initialize:function(t){var e=this;this._map=t,this.shapes=["Marker","Line","Poly","Rectangle","Circle","Cut"],this.shapes.forEach(function(t){e[t]=new L.PM.Draw[t](e._map)})},setPathOptions:function(t){this.options.pathOptions=t},getShapes:function(){return this.shapes},enable:function(t,e){if(!t)throw new Error("Error: Please pass a shape as a parameter. Possible shapes are: ".concat(this.getShapes().join(",")));this.disable(),this[t].enable(e)},disable:function(){var t=this;this.shapes.forEach(function(e){t[e].disable()})},addControls:function(){var t=this;this.shapes.forEach(function(e){t[e].addButton()})}});e["default"]=r},function(t,e,n){"use strict";function i(t,e,n){if(n=n||{},!u(n))throw new Error("options is invalid");var i=n.bbox,r=n.id;if(t===undefined)throw new Error("geometry is required");if(e&&e.constructor!==Object)throw new Error("properties must be an Object");i&&l(i),r&&h(r);var o={type:"Feature"};return r&&(o.id=r),i&&(o.bbox=i),o.properties=e||{},o.geometry=t,o}function r(t,e,n){if(!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(!a(t[0])||!a(t[1]))throw new Error("coordinates must contain numbers");return i({type:"Point",coordinates:t},e,n)}function o(t,e,n){if(!t)throw new Error("coordinates is required");for(var r=0;r<t.length;r++){var o=t[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(0===r&&0===s&&!a(o[0][0])||!a(o[0][1]))throw new Error("coordinates must contain numbers");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 s(t,e,n){if(!t)throw new Error("coordinates is required");if(t.length<2)throw new Error("coordinates must be an array of two or more positions");if(!a(t[0][1])||!a(t[0][1]))throw new Error("coordinates must contain numbers");return i({type:"LineString",coordinates:t},e,n)}function a(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function u(t){return!!t&&t.constructor===Object}function l(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(function(t){if(!a(t))throw new Error("bbox must only contain numbers")})}function h(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}n.d(e,"a",function(){return i}),n.d(e,"e",function(){return r}),n.d(e,"d",function(){return s}),n.d(e,"b",function(){return a}),n.d(e,"c",function(){return u})},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=void 0;var r=i(n(5)),o=i(n(26)),s=L.Class.extend({includes:[o["default"],r["default"]],options:{snappable:!0,snapDistance:20,allowSelfIntersection:!0,draggable:!0},isPolygon:function(){return this._layer instanceof L.Polygon}});e["default"]=s},function(t,e,n){"use strict";function i(t,e,n){if(null!=
|