summaryrefslogtreecommitdiff
path: root/node_modules/pigeon-maps/src/providers.ts
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/pigeon-maps/src/providers.ts')
-rw-r--r--node_modules/pigeon-maps/src/providers.ts24
1 files changed, 24 insertions, 0 deletions
diff --git a/node_modules/pigeon-maps/src/providers.ts b/node_modules/pigeon-maps/src/providers.ts
new file mode 100644
index 0000000..5a11046
--- /dev/null
+++ b/node_modules/pigeon-maps/src/providers.ts
@@ -0,0 +1,24 @@
+export function osm(x: number, y: number, z: number): string {
+ const s = String.fromCharCode(97 + ((x + y + z) % 3))
+ return `https://tile.openstreetmap.org/${z}/${x}/${y}.png`
+}
+
+export function stamenToner(x: number, y: number, z: number, dpr = 1): string {
+ return `https://stamen-tiles.a.ssl.fastly.net/toner/${z}/${x}/${y}${dpr >= 2 ? '@2x' : ''}.png`
+}
+
+export function stamenTerrain(x: number, y: number, z: number, dpr = 1): string {
+ return `https://stamen-tiles.a.ssl.fastly.net/terrain/${z}/${x}/${y}${dpr >= 2 ? '@2x' : ''}.jpg`
+}
+
+export const maptiler =
+ (apiKey: string, map = 'streets') =>
+ (x: number, y: number, z: number, dpr = 1): string => {
+ return `https://api.maptiler.com/maps/${map}/256/${z}/${x}/${y}${dpr >= 2 ? '@2x' : ''}.png?key=${apiKey}`
+ }
+
+export const stadiamaps =
+ (style = 'alidade_smooth') =>
+ (x: number, y: number, z: number, dpr = 1): string => {
+ return `https://tiles.stadiamaps.com/styles/${style}/${z}/${x}/${y}${dpr >= 2 ? '@2x' : ''}.png`
+ }