dawarich/vendor/javascript/leaflet-draw.js

3 lines
71 KiB
JavaScript
Raw Normal View History

2024-07-21 14:09:42 -04:00
var t,e;var i="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:global;!function(a,n,s){function o(t,e){for(;(t=t.parentElement)&&!t.classList.contains(e););return t}L.drawVersion="1.0.4",L.Draw={},L.drawLocal={draw:{toolbar:{actions:{title:"Cancel drawing",text:"Cancel"},finish:{title:"Finish drawing",text:"Finish"},undo:{title:"Delete last point drawn",text:"Delete last point"},buttons:{polyline:"Draw a polyline",polygon:"Draw a polygon",rectangle:"Draw a rectangle",circle:"Draw a circle",marker:"Draw a marker",circlemarker:"Draw a circlemarker"}},handlers:{circle:{tooltip:{start:"Click and drag to draw circle."},radius:"Radius"},circlemarker:{tooltip:{start:"Click map to place circle marker."}},marker:{tooltip:{start:"Click map to place marker."}},polygon:{tooltip:{start:"Click to start drawing shape.",cont:"Click to continue drawing shape.",end:"Click first point to close this shape."}},polyline:{error:"<strong>Error:</strong> shape edges cannot cross!",tooltip:{start:"Click to start drawing line.",cont:"Click to continue drawing line.",end:"Click last point to finish line."}},rectangle:{tooltip:{start:"Click and drag to draw rectangle."}},simpleshape:{tooltip:{end:"Release mouse to finish drawing."}}}},edit:{toolbar:{actions:{save:{title:"Save changes",text:"Save"},cancel:{title:"Cancel editing, discards all changes",text:"Cancel"},clearAll:{title:"Clear all layers",text:"Clear All"}},buttons:{edit:"Edit layers",editDisabled:"No layers to edit",remove:"Delete layers",removeDisabled:"No layers to delete"}},handlers:{edit:{tooltip:{text:"Drag handles or markers to edit features.",subtext:"Click cancel to undo changes."}},remove:{tooltip:{text:"Click on a feature to remove."}}}}},L.Draw.Event={},L.Draw.Event.CREATED="draw:created",L.Draw.Event.EDITED="draw:edited",L.Draw.Event.DELETED="draw:deleted",L.Draw.Event.DRAWSTART="draw:drawstart",L.Draw.Event.DRAWSTOP="draw:drawstop",L.Draw.Event.DRAWVERTEX="draw:drawvertex",L.Draw.Event.EDITSTART="draw:editstart",L.Draw.Event.EDITMOVE="draw:editmove",L.Draw.Event.EDITRESIZE="draw:editresize",L.Draw.Event.EDITVERTEX="draw:editvertex",L.Draw.Event.EDITSTOP="draw:editstop",L.Draw.Event.DELETESTART="draw:deletestart",L.Draw.Event.DELETESTOP="draw:deletestop",L.Draw.Event.TOOLBAROPENED="draw:toolbaropened",L.Draw.Event.TOOLBARCLOSED="draw:toolbarclosed",L.Draw.Event.MARKERCONTEXT="draw:markercontext",L.Draw=L.Draw||{},L.Draw.Feature=L.Handler.extend({initialize:function(t,e){(this||i)._map=t,(this||i)._container=t._container,(this||i)._overlayPane=t._panes.overlayPane,(this||i)._popupPane=t._panes.popupPane,e&&e.shapeOptions&&(e.shapeOptions=L.Util.extend({},(this||i).options.shapeOptions,e.shapeOptions)),L.setOptions(this||i,e);var a=L.version.split(".");1===parseInt(a[0],10)&&parseInt(a[1],10)>=2?L.Draw.Feature.include(L.Evented.prototype):L.Draw.Feature.include(L.Mixin.Events)},enable:function(){(this||i)._enabled||(L.Handler.prototype.enable.call(this||i),this.fire("enabled",{handler:(this||i).type}),(this||i)._map.fire(L.Draw.Event.DRAWSTART,{layerType:(this||i).type}))},disable:function(){(this||i)._enabled&&(L.Handler.prototype.disable.call(this||i),(this||i)._map.fire(L.Draw.Event.DRAWSTOP,{layerType:(this||i).type}),this.fire("disabled",{handler:(this||i).type}))},addHooks:function(){var t=(this||i)._map;t&&(L.DomUtil.disableTextSelection(),t.getContainer().focus(),(this||i)._tooltip=new L.Draw.Tooltip((this||i)._map),L.DomEvent.on((this||i)._container,"keyup",(this||i)._cancelDrawing,this||i))},removeHooks:function(){(this||i)._map&&(L.DomUtil.enableTextSelection(),(this||i)._tooltip.dispose(),(this||i)._tooltip=null,L.DomEvent.off((this||i)._container,"keyup",(this||i)._cancelDrawing,this||i))},setOptions:function(t){L.setOptions(this||i,t)},_fireCreatedEvent:function(t){(this||i)._map.fire(L.Draw.Event.CREATED,{layer:t,layerType:(this||i).type})},_cancelDrawing:function(t){27===t.keyCode&&((this||i)._map.fire("draw:canceled",{layerType:(this||i).type}),this.disable())}}),L.Draw.Polyline=L.Draw.Feature.extend({statics:{TYPE:"polyline"},Poly:L.Po