/** * Minified by jsDelivr using Terser v3.14.1. * Original file: /npm/leaflet-textpath@1.2.3/leaflet.textpath.js * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ !function(){var t=L.Polyline.prototype.onAdd,e=L.Polyline.prototype.onRemove,i=L.Polyline.prototype._updatePath,r=L.Polyline.prototype.bringToFront,o={onAdd:function(e){t.call(this,e),this._textRedraw()},onRemove:function(t){(t=t||this._map)&&this._textNode&&t._renderer._container&&t._renderer._container.removeChild(this._textNode),e.call(this,t)},bringToFront:function(){r.call(this),this._textRedraw()},_updatePath:function(){i.call(this),this._textRedraw()},_textRedraw:function(){var t=this._text,e=this._textOptions;t&&this.setText(null).setText(t,e)},setText:function(t,e){if(this._text=t,this._textOptions=e,!L.Browser.svg||void 0===this._map)return this;if(e=L.Util.extend({repeat:!1,fillColor:"black",attributes:{},below:!1},e),!t)return this._textNode&&this._textNode.parentNode&&(this._map._renderer._container.removeChild(this._textNode),delete this._textNode),this;t=t.replace(/ /g," ");var i="pathdef-"+L.Util.stamp(this),r=this._map._renderer._container;if(this._path.setAttribute("id",i),e.repeat){var o=L.SVG.create("text");for(var n in e.attributes)o.setAttribute(n,e.attributes[n]);o.appendChild(document.createTextNode(t)),r.appendChild(o);var a=o.getComputedTextLength();r.removeChild(o),t=new Array(Math.ceil(isNaN(this._path.getTotalLength()/a)?0:this._path.getTotalLength()/a)).join(t)}var s=L.SVG.create("text"),h=L.SVG.create("textPath"),l=e.offset||this._path.getAttribute("stroke-width");for(var n in h.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","#"+i),s.setAttribute("dy",l),e.attributes)s.setAttribute(n,e.attributes[n]);if(h.appendChild(document.createTextNode(t)),s.appendChild(h),this._textNode=s,e.below?r.insertBefore(s,r.firstChild):r.appendChild(s),e.center){var d=s.getComputedTextLength(),p=this._path.getTotalLength();s.setAttribute("dx",p/2-d/2)}if(e.orientation){var u=0;switch(e.orientation){case"flip":u=180;break;case"perpendicular":u=90;break;default:u=e.orientation}var c=s.getBBox().x+s.getBBox().width/2,x=s.getBBox().y+s.getBBox().height/2;s.setAttribute("transform","rotate("+u+" "+c+" "+x+")")}if(this.options.interactive){!L.Browser.svg&&L.Browser.vml||h.setAttribute("class","leaflet-interactive");for(var _=["click","dblclick","mousedown","mouseover","mouseout","mousemove","contextmenu"],f=0;f<_.length;f++)L.DomEvent.on(s,_[f],this.fire,this)}return this}};L.Polyline.include(o),L.LayerGroup.include({setText:function(t,e){for(var i in this._layers)"function"==typeof this._layers[i].setText&&this._layers[i].setText(t,e);return this}})}(); //# sourceMappingURL=/sm/e7f0bc8ef83adb93ee182345e0d50ab672355ce87b2d01905a7d7913353e3382.map