PageSourceSearch

https://cuartohache.com/jslocal/MarkerCluster.QuickHull.js

js cuartohache.com collected 2026-10-08 09:08:54 UTC 1,780 bytes, 1 lines download raw bytes

vendor: 1,780 bytes, line 1
1(function(){L.QuickHull={getDistant:function(cpt,bl){var vY=bl[1].lat-bl[0].lat,vX=bl[0].lng-bl[1].lng;return(vX*(cpt.lat-bl[0].lat)+vY*(cpt.lng-bl[0].lng));},findMostDistantPointFromBaseLine:function(baseLine,latLngs){var maxD=0,maxPt=null,newPoints=[],i,pt,d;for(i=latLngs.length-1;i>=0;i--){pt=latLngs[i];d=this.getDistant(pt,baseLine);if(d>0){newPoints.push(pt);}else{continue;}if(d>maxD){maxD=d;maxPt=pt;}}return{maxPoint:maxPt,newPoints:newPoints};},buildConvexHull:function(baseLine,latLngs){var convexHullBaseLines=[],t=this.findMostDistantPointFromBaseLine(baseLine,latLngs);if(t.maxPoint){convexHullBaseLines=convexHullBaseLines.concat(this.buildConvexHull([baseLine[0],t.maxPoint],t.newPoints));convexHullBaseLines=convexHullBaseLines.concat(this.buildConvexHull([t.maxPoint,baseLine[1]],t.newPoints));return convexHullBaseLines;}else{return[baseLine[0]];}},getConvexHull:function(latLngs){var maxLat=false,minLat=false,maxLng=false,minLng=false,maxLatPt=null,minLatPt=null,maxLngPt=null,minLngPt=null,maxPt=null,minPt=null,i;for(i=latLngs.length-1;i>=0;i--){var pt=latLngs[i];if(maxLat===false||pt.lat>maxLat){maxLatPt=pt;maxLat=pt.lat;}if(minLat===false||pt.lat<minLat){minLatPt=pt;minLat=pt.lat;}if(maxLng===false||pt.lng>maxLng){maxLngPt=pt;maxLng=pt.lng;}if(minLng===false||pt.lng<minLng){minLngPt=pt;minLng=pt.lng;}}if(minLat!==maxLat){minPt=minLatPt;maxPt=maxLatPt;}else{minPt=minLngPt;maxPt=maxLngPt;}var ch=[].concat(this.buildConvexHull([minPt,maxPt],latLngs),this.buildConvexHull([maxPt,minPt],latLngs));return ch;}};}());L.MarkerCluster.include({getConvexHull:function(){var childMarkers=this.getAllChildMarkers(),points=[],p,i;for(i=childMarkers.length-1;i>=0;i--){p=childMarkers[i].getLatLng();points.push(p);}return L.QuickHull.getConvexHull(points);}});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.