| 1 | import type * as location from "@distilled.cloud/aws/location"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Map as LocationMap } from "./Map.ts"; |
| 5 | |
| 6 | /** |
| 7 | * `GetMapTile` request with `MapName` injected from the bound |
| 8 | * resource. |
| 9 | */ |
| 10 | export interface GetMapTileRequest extends Omit< |
| 11 | location.GetMapTileRequest, |
| 12 | "MapName" |
| 13 | > {} |
| 14 | |
| 15 | /** |
| 16 | * Retrieves a single map tile (vector or raster) addressed by zoom/x/y. |
| 17 | * |
| 18 | * Runtime binding for the `GetMapTile` operation (IAM action |
| 19 | * `geo:GetMapTile`), scoped to one {@link LocationMap | Map}. Provide the implementation with |
| 20 | * `Effect.provide(AWS.Location.GetMapTileHttp)`. |
| 21 | * |
| 22 | * ### Serving Map Assets |
| 23 | * **Example:** Serve a Tile |
| 24 | * ```typescript |
| 25 | * const getTile = yield* Location.GetMapTile(map); |
| 26 | * |
| 27 | * const tile = yield* getTile({ Z: "0", X: "0", Y: "0" }); |
| 28 | * // tile.Blob → tile bytes, tile.ContentType → e.g. "application/vnd.mapbox-vector-tile" |
| 29 | * ``` |
| 30 | * |
| 31 | * @binding |
| 32 | */ |
| 33 | export interface GetMapTile extends Binding.Service< |
| 34 | GetMapTile, |
| 35 | "AWS.Location.GetMapTile", |
| 36 | ( |
| 37 | map: LocationMap, |
| 38 | ) => Effect.Effect< |
| 39 | ( |
| 40 | request: GetMapTileRequest, |
| 41 | ) => Effect.Effect<location.GetMapTileResponse, location.GetMapTileError> |
| 42 | > |
| 43 | > {} |
| 44 | export const GetMapTile = Binding.Service<GetMapTile>( |
| 45 | "AWS.Location.GetMapTile", |
| 46 | ); |