PageSourceSearch

https://freightcompare.ai/assets/mapProjection-BoeLmytC.js

js freightcompare.ai collected 2026-10-02 01:12:03 UTC 1,631 bytes, 1 lines download raw bytes

1const m={minLat:8,maxLat:37.5,minLng:68,maxLng:97.5},f={width:612,height:696};function p(t,a,l=f,n=m){const e=Math.max(n.minLat,Math.min(n.maxLat,t)),c=(Math.max(n.minLng,Math.min(n.maxLng,a))-n.minLng)/(n.maxLng-n.minLng)*l.width,i=(n.maxLat-e)/(n.maxLat-n.minLat)*l.height;return{x:c,y:i}}let s=null,o=null;async function g(){return s||o||(o=fetch("/pincode_centroids.json",{cache:"force-cache"}).then(t=>{if(!t.ok)throw new Error(`Failed to load centroids: ${t.status}`);return t.json()}).then(t=>{const a=new Map;for(const l of t)l.pincode&&typeof l.lat=="number"&&typeof l.lng=="number"&&a.set(l.pincode,{lat:l.lat,lng:l.lng});return s=a,console.log(`✅ Centroids loaded: ${a.size} pincodes`),a}).catch(t=>(console.error("Failed to load pincode centroids:",t),o=null,new Map)),o)}function d(t){return s&&s.get(t)||null}const u={1:{lat:28.7,lng:77.1},2:{lat:27,lng:80},3:{lat:25.5,lng:73.5},4:{lat:19.5,lng:75.5},5:{lat:16.5,lng:79.5},6:{lat:11,lng:78},7:{lat:23,lng:87.5},8:{lat:25.5,lng:85.5},9:{lat:26,lng:92}};function M(t){const a=d(t);if(a)return a;if(t.length>0){const l=t.charAt(0);return u[l]||null}return null}function L(t,a){const n=i=>i*Math.PI/180,e=n(a.lat-t.lat),r=n(a.lng-t.lng),c=Math.sin(e/2)**2+Math.cos(n(t.lat))*Math.cos(n(a.lat))*Math.sin(r/2)**2;return 2*6371*Math.atan2(Math.sqrt(c),Math.sqrt(1-c))}async function x(t,a,l=50){const n=await g();let e=null,r=1/0;for(const[c,i]of n){const h=L({lat:t,lng:a},i);h<r&&(r=h,e=c)}return r<=l?e:null}export{m as INDIA_GEO_BOUNDS,f as INDIA_SVG_VIEWBOX,x as findNearestPincode,d as getCentroid,M as getCentroidWithFallback,p as latLngToSvg,g as loadCentroids};

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.