This file is indexed.

/usr/share/javascript/leaflet/leaflet.geometryutil.min.js is in libjs-leaflet-geometryutil 0.4.0-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

1
(function(factory){var L;if(typeof define==="function"&&define.amd){define(["leaflet"],factory)}else if(typeof module!=="undefined"){L=require("leaflet");module.exports=factory(L)}else{if(typeof window.L==="undefined")throw"Leaflet must be loaded first";factory(window.L)}})(function(L){"use strict";L.GeometryUtil=L.extend(L.GeometryUtil||{},{distance:function(map,latlngA,latlngB){return map.latLngToLayerPoint(latlngA).distanceTo(map.latLngToLayerPoint(latlngB))},distanceSegment:function(map,latlng,latlngA,latlngB){var p=map.latLngToLayerPoint(latlng),p1=map.latLngToLayerPoint(latlngA),p2=map.latLngToLayerPoint(latlngB);return L.LineUtil.pointToSegmentDistance(p,p1,p2)},readableDistance:function(distance,unit){var isMetric=unit!=="imperial",distanceStr;if(isMetric){if(distance>1e3){distanceStr=(distance/1e3).toFixed(2)+" km"}else{distanceStr=Math.ceil(distance)+" m"}}else{distance*=1.09361;if(distance>1760){distanceStr=(distance/1760).toFixed(2)+" miles"}else{distanceStr=Math.ceil(distance)+" yd"}}return distanceStr},belongsSegment:function(latlng,latlngA,latlngB,tolerance){tolerance=tolerance===undefined?.2:tolerance;var hypotenuse=latlngA.distanceTo(latlngB),delta=latlngA.distanceTo(latlng)+latlng.distanceTo(latlngB)-hypotenuse;return delta/hypotenuse<tolerance},length:function(coords){var accumulated=L.GeometryUtil.accumulatedLengths(coords);return accumulated.length>0?accumulated[accumulated.length-1]:0},accumulatedLengths:function(coords){if(typeof coords.getLatLngs=="function"){coords=coords.getLatLngs()}if(coords.length===0)return[];var total=0,lengths=[0];for(var i=0,n=coords.length-1;i<n;i++){total+=coords[i].distanceTo(coords[i+1]);lengths.push(total)}return lengths},closestOnSegment:function(map,latlng,latlngA,latlngB){var maxzoom=map.getMaxZoom();if(maxzoom===Infinity)maxzoom=map.getZoom();var p=map.project(latlng,maxzoom),p1=map.project(latlngA,maxzoom),p2=map.project(latlngB,maxzoom),closest=L.LineUtil.closestPointOnSegment(p,p1,p2);return map.unproject(closest,maxzoom)},closest:function(map,layer,latlng,vertices){if(typeof layer.getLatLngs!="function")layer=L.polyline(layer);var latlngs=layer.getLatLngs().slice(0),mindist=Infinity,result=null,i,n,distance;if(vertices){for(i=0,n=latlngs.length;i<n;i++){var ll=latlngs[i];distance=L.GeometryUtil.distance(map,latlng,ll);if(distance<mindist){mindist=distance;result=ll;result.distance=distance}}return result}if(layer instanceof L.Polygon){latlngs.push(latlngs[0])}for(i=0,n=latlngs.length;i<n-1;i++){var latlngA=latlngs[i],latlngB=latlngs[i+1];distance=L.GeometryUtil.distanceSegment(map,latlng,latlngA,latlngB);if(distance<=mindist){mindist=distance;result=L.GeometryUtil.closestOnSegment(map,latlng,latlngA,latlngB);result.distance=distance}}return result},closestLayer:function(map,layers,latlng){var mindist=Infinity,result=null,ll=null,distance=Infinity;for(var i=0,n=layers.length;i<n;i++){var layer=layers[i];if(typeof layer.getLatLng=="function"){ll=layer.getLatLng();distance=L.GeometryUtil.distance(map,latlng,ll)}else{ll=L.GeometryUtil.closest(map,layer,latlng);if(ll)distance=ll.distance}if(distance<mindist){mindist=distance;result={layer:layer,latlng:ll,distance:distance}}}return result},closestLayerSnap:function(map,layers,latlng,tolerance,withVertices){tolerance=typeof tolerance=="number"?tolerance:Infinity;withVertices=typeof withVertices=="boolean"?withVertices:true;var result=L.GeometryUtil.closestLayer(map,layers,latlng);if(!result||result.distance>tolerance)return null;if(withVertices&&typeof result.layer.getLatLngs=="function"){var closest=L.GeometryUtil.closest(map,result.layer,result.latlng,true);if(closest.distance<tolerance){result.latlng=closest;result.distance=L.GeometryUtil.distance(map,closest,latlng)}}return result},interpolateOnPointSegment:function(pA,pB,ratio){return L.point(pA.x*(1-ratio)+ratio*pB.x,pA.y*(1-ratio)+ratio*pB.y)},interpolateOnLine:function(map,latLngs,ratio){latLngs=latLngs instanceof L.Polyline?latLngs.getLatLngs():latLngs;var n=latLngs.length;if(n<2){return null}if(ratio===0){return{latLng:latLngs[0]instanceof L.LatLng?latLngs[0]:L.latLng(latLngs[0]),predecessor:-1}}if(ratio==1){return{latLng:latLngs[latLngs.length-1]instanceof L.LatLng?latLngs[latLngs.length-1]:L.latLng(latLngs[latLngs.length-1]),predecessor:latLngs.length-2}}ratio=Math.max(Math.min(ratio,1),0);var maxzoom=map.getMaxZoom();if(maxzoom===Infinity)maxzoom=map.getZoom();var pts=[];var lineLength=0;for(var i=0;i<n;i++){pts[i]=map.project(latLngs[i],maxzoom);if(i>0)lineLength+=pts[i-1].distanceTo(pts[i])}var ratioDist=lineLength*ratio;var a=pts[0],b=pts[1],distA=0,distB=a.distanceTo(b);var index=1;for(;index<n&&distB<ratioDist;index++){a=b;distA=distB;b=pts[index];distB+=a.distanceTo(b)}var segmentRatio=distB-distA!==0?(ratioDist-distA)/(distB-distA):0;var interpolatedPoint=L.GeometryUtil.interpolateOnPointSegment(a,b,segmentRatio);return{latLng:map.unproject(interpolatedPoint,maxzoom),predecessor:index-2}},locateOnLine:function(map,polyline,latlng){var latlngs=polyline.getLatLngs();if(latlng.equals(latlngs[0]))return 0;if(latlng.equals(latlngs[latlngs.length-1]))return 1;var point=L.GeometryUtil.closest(map,polyline,latlng,false),lengths=L.GeometryUtil.accumulatedLengths(latlngs),total_length=lengths[lengths.length-1],portion=0,found=false;for(var i=0,n=latlngs.length-1;i<n;i++){var l1=latlngs[i],l2=latlngs[i+1];portion=lengths[i];if(L.GeometryUtil.belongsSegment(point,l1,l2)){portion+=l1.distanceTo(point);found=true;break}}if(!found){throw"Could not interpolate "+latlng.toString()+" within "+polyline.toString()}return portion/total_length},reverse:function(polyline){return L.polyline(polyline.getLatLngs().slice(0).reverse())},extract:function(map,polyline,start,end){if(start>end){return L.GeometryUtil.extract(map,L.GeometryUtil.reverse(polyline),1-start,1-end)}start=Math.max(Math.min(start,1),0);end=Math.max(Math.min(end,1),0);var latlngs=polyline.getLatLngs(),startpoint=L.GeometryUtil.interpolateOnLine(map,polyline,start),endpoint=L.GeometryUtil.interpolateOnLine(map,polyline,end);if(start==end){var point=L.GeometryUtil.interpolateOnLine(map,polyline,end);return[point.latLng]}if(startpoint.predecessor==-1)startpoint.predecessor=0;if(endpoint.predecessor==-1)endpoint.predecessor=0;var result=latlngs.slice(startpoint.predecessor+1,endpoint.predecessor+1);result.unshift(startpoint.latLng);result.push(endpoint.latLng);return result},isBefore:function(polyline,other){if(!other)return false;var lla=polyline.getLatLngs(),llb=other.getLatLngs();return lla[lla.length-1].equals(llb[0])},isAfter:function(polyline,other){if(!other)return false;var lla=polyline.getLatLngs(),llb=other.getLatLngs();return lla[0].equals(llb[llb.length-1])},startsAtExtremity:function(polyline,other){if(!other)return false;var lla=polyline.getLatLngs(),llb=other.getLatLngs(),start=lla[0];return start.equals(llb[0])||start.equals(llb[llb.length-1])},computeAngle:function(a,b){return Math.atan2(b.y-a.y,b.x-a.x)*180/Math.PI},computeSlope:function(a,b){var s=(b.y-a.y)/(b.x-a.x),o=a.y-s*a.x;return{a:s,b:o}},rotatePoint:function(map,latlngPoint,angleDeg,latlngCenter){var maxzoom=map.getMaxZoom();if(maxzoom===Infinity)maxzoom=map.getZoom();var angleRad=angleDeg*Math.PI/180,pPoint=map.project(latlngPoint,maxzoom),pCenter=map.project(latlngCenter,maxzoom),x2=Math.cos(angleRad)*(pPoint.x-pCenter.x)-Math.sin(angleRad)*(pPoint.y-pCenter.y)+pCenter.x,y2=Math.sin(angleRad)*(pPoint.x-pCenter.x)+Math.cos(angleRad)*(pPoint.y-pCenter.y)+pCenter.y;return map.unproject(new L.Point(x2,y2),maxzoom)},bearing:function(latlng1,latlng2){var rad=Math.PI/180,lat1=latlng1.lat*rad,lat2=latlng2.lat*rad,lon1=latlng1.lng*rad,lon2=latlng2.lng*rad,y=Math.sin(lon2-lon1)*Math.cos(lat2),x=Math.cos(lat1)*Math.sin(lat2)-Math.sin(lat1)*Math.cos(lat2)*Math.cos(lon2-lon1);var bearing=(Math.atan2(y,x)*180/Math.PI+360)%360;return bearing>=180?bearing-360:bearing},destination:function(latlng,heading,distance){heading=(heading+360)%360;var rad=Math.PI/180,radInv=180/Math.PI,R=6378137,lon1=latlng.lng*rad,lat1=latlng.lat*rad,rheading=heading*rad,sinLat1=Math.sin(lat1),cosLat1=Math.cos(lat1),cosDistR=Math.cos(distance/R),sinDistR=Math.sin(distance/R),lat2=Math.asin(sinLat1*cosDistR+cosLat1*sinDistR*Math.cos(rheading)),lon2=lon1+Math.atan2(Math.sin(rheading)*sinDistR*cosLat1,cosDistR-sinLat1*Math.sin(lat2));lon2=lon2*radInv;lon2=lon2>180?lon2-360:lon2<-180?lon2+360:lon2;return L.latLng([lat2*radInv,lon2])}});return L.GeometryUtil});