From ebe123a6d40bf17ab2a35f331fb08c8c0fc76a3a Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Tue, 3 Nov 2026 23:18:23 +0100 Subject: Update vendored Leaflet Elevation and map dependencies --- .../static/vendor/leaflet-elevation/libs/leaflet-distance-marker.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'assets/static/vendor/leaflet-elevation/libs/leaflet-distance-marker.min.js') diff --git a/assets/static/vendor/leaflet-elevation/libs/leaflet-distance-marker.min.js b/assets/static/vendor/leaflet-elevation/libs/leaflet-distance-marker.min.js index b8bc58b..1b669ed 100644 --- a/assets/static/vendor/leaflet-elevation/libs/leaflet-distance-marker.min.js +++ b/assets/static/vendor/leaflet-elevation/libs/leaflet-distance-marker.min.js @@ -1 +1 @@ -L.DistanceMarker=L.CircleMarker.extend({_updatePath:function(){let ctx=this._renderer._ctx,p=this._point;if(this.options.rotation=this.options.rotation||0,this.options.radius&&this._renderer._updateCircle&&this._renderer._updateCircle(this),this.options.icon&&this.options.icon.url)if(this.options.icon.element){const icon=this.options.icon;let cx=p.x+icon.offset.x,cy=p.y+icon.offset.y;ctx.save(),icon.rotate&&(ctx.translate(p.x,p.y),ctx.rotate(icon.rotate),cx=0,cy=0),ctx.drawImage(icon.element,cx-icon.size[0]/2,cy-icon.size[1]/2,icon.size[0],icon.size[1]),ctx.restore()}else{const icon=document.createElement("img");this.options.icon=L.extend({rotate:0,size:[40,40],offset:{x:0,y:0}},this.options.icon),this.options.icon.rotate+=this.options.rotation,this.options.icon.element=icon,icon.src=this.options.icon.url,icon.onload=()=>this.redraw(),icon.onerror=()=>this.options.icon=null}if(this.options.label){let cx=p.x,cy=p.y;ctx.save(),ctx.font=this.options.font||'normal 7pt "Helvetica Neue", Arial, Helvetica, sans-serif',ctx.textAlign="center",ctx.textBaseline="middle",ctx.fillStyle=this.options.fillStyle||"black",this.options.rotation&&(ctx.translate(p.x,p.y),ctx.rotate(this.options.rotation),cx=0,cy=0),this._map.getZoom()>17&&(ctx.fillStyle=this.options.strokeStyle||"black"),ctx.fillText(this.options.label,cx,cy),this.options.strokeStyle&&this._map.getZoom()<=17&&(ctx.strokeStyle=this.options.strokeStyle,ctx.strokeText(this.options.label,cx,cy)),ctx.restore()}}}),L.DistanceMarkers=L.LayerGroup.extend({options:{cssClass:"dist-marker",iconSize:[12,12],arrowSize:[10,10],arrowUrl:"data:image/svg+xml,%3Csvg transform='rotate(90)' xmlns='http://www.w3.org/2000/svg' width='560px' height='560px' viewBox='0 0 560 560'%3E%3Cpath stroke-width='35' fill='%23000' stroke='%23FFF' d='M280,40L522,525L280,420L38,525z'/%3E%3C/svg%3E",offset:1e3,showAll:12,textFunction:(distance,i,offset)=>i,distance:!0,direction:!0},initialize:function(line,map,options){this._layers={},this._zoomLayers={},options=L.setOptions(this,options);let preferCanvas=map.options.preferCanvas,showAll=Math.min(map.getMaxZoom(),options.showAll);preferCanvas||map.options.rotate||console.warn('Missing dependency: "leaflet-rotate"');let coords="function"==typeof line.getLatLngs?line.getLatLngs():line;coords=L.LineUtil.isFlat(coords)?[coords]:coords,coords.forEach(latlngs=>{let accumulated=L.GeometryUtil.accumulatedLengths(latlngs),length=accumulated.length>0?accumulated[accumulated.length-1]:0;for(let i=1,count=Math.floor(length/options.offset),j=0;i<=count;++i){let distance=options.offset*i;for(;j{let oldZoom=this._lastZoomLevel||0,newZoom=map.getZoom();if(newZoom>oldZoom)for(let i=oldZoom+1;i<=newZoom;++i)void 0!==this._zoomLayers[i]&&this.addLayer(this._zoomLayers[i]);else if(newZoomnewZoom;--i)void 0!==this._zoomLayers[i]&&this.removeLayer(this._zoomLayers[i]);this._lastZoomLevel=newZoom};map.on("zoomend",updateMarkerVisibility),updateMarkerVisibility()},_minimumZoomLevelForItem:function(i,zoom){for(;i>0&&i%2==0;)--zoom,i=Math.floor(i/2);return zoom}}),L.Polyline.include({_originalOnAdd:L.Polyline.prototype.onAdd,_originalOnRemove:L.Polyline.prototype.onRemove,addDistanceMarkers:function(){this._map&&this._distanceMarkers&&this._map.addLayer(this._distanceMarkers)},removeDistanceMarkers:function(){this._map&&this._distanceMarkers&&this._map.removeLayer(this._distanceMarkers)},onAdd:function(map){this._originalOnAdd(map);let opts=this.options.distanceMarkers||{};this.options.distanceMarkers&&(this._distanceMarkers=this._distanceMarkers||new L.DistanceMarkers(this,map,opts)),void 0!==opts.lazy&&!1!==opts.lazy||this.addDistanceMarkers()},onRemove:function(map){this.removeDistanceMarkers(),this._originalOnRemove(map)}}); \ No newline at end of file +L.DistanceMarker=L.CircleMarker.extend({_updatePath(){let t=this._renderer._ctx,i=this._point;if(this.options.rotation=this.options.rotation||0,this.options.radius&&this._renderer._updateCircle&&this._renderer._updateCircle(this),this.options.icon&&this.options.icon.url)if(this.options.icon.element){const e=this.options.icon;let s=i.x+e.offset.x,h=i.y+e.offset.y;t.save(),e.rotate&&(t.translate(i.x,i.y),t.rotate(e.rotate),s=0,h=0),t.drawImage(e.element,s-e.size[0]/2,h-e.size[1]/2,e.size[0],e.size[1]),t.restore()}else{const e=document.createElement("img");this.options.icon=Object.assign({rotate:0,size:[40,40],offset:{x:0,y:0}},this.options.icon),this.options.icon.rotate+=this.options.rotation,this.options.icon.element=e,e.src=this.options.icon.url,e.onload=()=>this.redraw(),e.onerror=()=>this.options.icon=null}if(this.options.label){let e=i.x,s=i.y;t.save(),t.font=this.options.font||'normal 7pt "Helvetica Neue", Arial, Helvetica, sans-serif',t.textAlign="center",t.textBaseline="middle",t.fillStyle=this.options.fillStyle||"black",this.options.rotation&&(t.translate(i.x,i.y),t.rotate(this.options.rotation),e=0,s=0),this._map.getZoom()>17&&(t.fillStyle=this.options.strokeStyle||"black"),t.fillText(this.options.label,e,s),this.options.strokeStyle&&this._map.getZoom()<=17&&(t.strokeStyle=this.options.strokeStyle,t.strokeText(this.options.label,e,s)),t.restore()}}}),L.DistanceMarkers=L.LayerGroup.extend({options:{cssClass:"dist-marker",iconSize:[12,12],arrowSize:[10,10],arrowUrl:"data:image/svg+xml,%3Csvg transform='rotate(90)' xmlns='http://www.w3.org/2000/svg' width='560px' height='560px' viewBox='0 0 560 560'%3E%3Cpath stroke-width='35' fill='%23000' stroke='%23FFF' d='M280,40L522,525L280,420L38,525z'/%3E%3C/svg%3E",offset:1e3,showAll:12,textFunction:(t,i,e)=>i,distance:!0,direction:!0},initialize(t,i,e){this._layers={},this._zoomLayers={},e=L.Util.setOptions(this,e);let s=i.options.preferCanvas,h=Math.min(i.getMaxZoom(),e.showAll);!s&&!i.options.rotate&&console.warn('Missing dependency: "leaflet-rotate"');let c=typeof t.getLatLngs=="function"?t.getLatLngs():t;c=L.LineUtil.isFlat(c)?[c]:c,c.forEach(r=>{let n=0,o=r.map((a,d)=>(d&&(n+=r[d-1].distanceTo(a)),n)),S=o.length>0?o[o.length-1]:0;for(let a=1,d=Math.floor(S/e.offset),l=0;a<=d;++a){let y=e.offset*a;for(;l{let r=this._lastZoomLevel||0,n=i.getZoom();if(n>r)for(let o=r+1;o<=n;++o)this._zoomLayers[o]!==void 0&&this.addLayer(this._zoomLayers[o]);else if(nn;--o)this._zoomLayers[o]!==void 0&&this.removeLayer(this._zoomLayers[o]);this._lastZoomLevel=n};i.on("zoomend",u),u()},_minimumZoomLevelForItem(t,i){for(;t>0&&t%2===0;)--i,t=Math.floor(t/2);return i}}),L.Polyline.include({_originalOnAdd:L.Polyline.prototype.onAdd,_originalOnRemove:L.Polyline.prototype.onRemove,addDistanceMarkers(){this._map&&this._distanceMarkers&&this._map.addLayer(this._distanceMarkers)},removeDistanceMarkers(){this._map&&this._distanceMarkers&&this._map.removeLayer(this._distanceMarkers)},onAdd(t){this._originalOnAdd(t);let i=this.options.distanceMarkers||{};this.options.distanceMarkers&&(this._distanceMarkers=this._distanceMarkers||new L.DistanceMarkers(this,t,i)),(i.lazy===void 0||i.lazy===!1)&&this.addDistanceMarkers()},onRemove(t){this.removeDistanceMarkers(),this._originalOnRemove(t)}}); -- cgit v1.3.1