import t from"@babel/runtime/helpers/slicedToArray";import{tileToBBOX as r,pointToTile as n}from"@mapbox/tilebelt";import"../components/Map/OffsetWellMap/constants.js";var a=11,e=12,o=25,l=function(t){if(t<=25)return 0;var r=t/25;return Math.log2(Math.sqrt(r))+.1},s=function(r){var n=t(r,3),a=n[0],e=n[1],o=n[2];return"".concat(o,"/").concat(a,"/").concat(e)},i=function(r){var n=r.split("/").map(Number),a=t(n,3),e=a[0];return[a[1],a[2],e]},u=function(n){var a=r(n),e=t(a,4),o=e[0],l=e[1],s=e[2];return{lat_start:l,lat_end:e[3],long_start:o,long_end:s}},c=function(t,r){return n(t,r,11)},m=function(t){var r=t.north,n=t.south,a=t.east,e=t.west,o=c(e,r),l=c(a,n),s=Math.min(o[0],l[0]),i=Math.max(o[0],l[0]),u=Math.min(o[1],l[1]);return(i-s+1)*(Math.max(o[1],l[1])-u+1)},p=function(t){for(var r=t.north,n=t.south,a=t.east,e=t.west,o=c(e,r),l=c(a,n),i=[],u=Math.min(o[0],l[0]),m=Math.max(o[0],l[0]),p=Math.min(o[1],l[1]),f=Math.max(o[1],l[1]),h=u;h<=m;h+=1)for(var _=p;_<=f;_+=1){var M=[h,_,11];i.push(s(M))}return i},f=function(t){return{type:"FeatureCollection",features:t.map((function(t){var r=i(t),n=u(r);return{type:"Feature",properties:{tileKey:t},geometry:{type:"Polygon",coordinates:[[[n.long_start,n.lat_start],[n.long_end,n.lat_start],[n.long_end,n.lat_end],[n.long_start,n.lat_end],[n.long_start,n.lat_start]]]}}}))}};export{e as MAX_TILES_FOR_FETCH,o as MAX_VIEWPORT_TILES_FOR_FETCH,a as TILE_ZOOM,m as estimateTileCount,p as getTilesForViewport,l as getZoomIncreaseForTileLimit,i as keyToTile,c as pointToTile,u as tileToBounds,s as tileToKey,f as tilesToGeoJSON};
//# sourceMappingURL=tile-math.js.map
