-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
136 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import type { MercatorBoundary, MercatorBoundingBox } from '../../types.ts' | ||
|
||
/** @deprecated use form @xylabs/geo */ | ||
export const boundingBoxToBoundary = (box: MercatorBoundingBox): MercatorBoundary => { | ||
return [box.getNorthWest(), box.getNorthEast(), box.getSouthEast(), box.getSouthWest(), box.getNorthWest()] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
const d2r = Math.PI / 180 | ||
const r2d = 180 / Math.PI | ||
/** @deprecated use form @xylabs/geo */ | ||
export const d2r = Math.PI / 180 | ||
|
||
export { d2r, r2d } | ||
/** @deprecated use form @xylabs/geo */ | ||
export const r2d = 180 / Math.PI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
import type { MercatorTile } from '../../types.ts' | ||
|
||
const tileToChildren = (tile: MercatorTile) => { | ||
/** @deprecated use form @xylabs/geo */ | ||
export const tileToChildren = (tile: MercatorTile) => { | ||
return [ | ||
[tile[0] * 2, tile[1] * 2, tile[2] + 1], | ||
[tile[0] * 2 + 1, tile[1] * 2, tile[2] + 1], | ||
[tile[0] * 2 + 1, tile[1] * 2 + 1, tile[2] + 1], | ||
[tile[0] * 2, tile[1] * 2 + 1, tile[2] + 1], | ||
] | ||
} | ||
|
||
export { tileToChildren } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import type { MercatorTile } from '../../types.ts' | ||
|
||
const tileToParent = (tile: MercatorTile): MercatorTile => { | ||
/** @deprecated use form @xylabs/geo */ | ||
export const tileToParent = (tile: MercatorTile): MercatorTile => { | ||
return [tile[0] >> 1, tile[1] >> 1, tile[2] - 1] | ||
} | ||
|
||
export { tileToParent } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
import type { MercatorLngLat, MercatorTile } from '../../types.ts' | ||
import { tileToBoundingBox } from './boundingbox.ts' | ||
|
||
const tileToPoint = (tile: MercatorTile): MercatorLngLat => { | ||
/** @deprecated use form @xylabs/geo */ | ||
export const tileToPoint = (tile: MercatorTile): MercatorLngLat => { | ||
const boundingBox = tileToBoundingBox(tile) | ||
boundingBox.getCenter() | ||
return boundingBox.getCenter() | ||
} | ||
|
||
export { tileToPoint } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import type { MercatorTile } from '../types.ts' | ||
|
||
const tilesEqual = (tile1: MercatorTile, tile2: MercatorTile) => { | ||
/** @deprecated use form @xylabs/geo */ | ||
export const tilesEqual = (tile1: MercatorTile, tile2: MercatorTile) => { | ||
return tile1[0] === tile2[0] && tile1[1] === tile2[1] && tile1[2] === tile2[2] | ||
} | ||
|
||
export { tilesEqual } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
import type { MercatorTile } from '../types.ts' | ||
import { tilesEqual } from './equal.ts' | ||
|
||
const tilesHasTile = (tiles: MercatorTile[], tile: MercatorTile) => { | ||
/** @deprecated use form @xylabs/geo */ | ||
export const tilesHasTile = (tiles: MercatorTile[], tile: MercatorTile) => { | ||
for (const tileToCheck of tiles) { | ||
if (tilesEqual(tileToCheck, tile)) return true | ||
} | ||
return false | ||
} | ||
|
||
export { tilesHasTile } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
import MapBox from 'mapbox-gl' | ||
|
||
type MercatorTile = number[] | ||
type MercatorBoundary = MercatorLngLat[] | ||
class MercatorBoundingBox extends MapBox.LngLatBounds {} | ||
class MercatorLngLat extends MapBox.LngLat {} | ||
|
||
export { MercatorBoundingBox, MercatorLngLat } | ||
export type { MercatorBoundary, MercatorTile } | ||
/** @deprecated use form @xylabs/geo */ | ||
export type MercatorTile = number[] | ||
/** @deprecated use form @xylabs/geo */ | ||
export type MercatorBoundary = MercatorLngLat[] | ||
/** @deprecated use form @xylabs/geo */ | ||
export class MercatorBoundingBox extends MapBox.LngLatBounds {} | ||
/** @deprecated use form @xylabs/geo */ | ||
export class MercatorLngLat extends MapBox.LngLat {} |
Oops, something went wrong.