Skip to content

GetStaticMap

Source: src/AWS/GeoMaps/GetStaticMap.ts

Runtime binding for geo-maps:GetStaticMap — render a static map image with customizable size, center, zoom, and overlays.

geo-maps is a standalone, pay-per-call Amazon Location API with no resource to manage: the binding takes no arguments and grants the function geo-maps:GetStaticMap. Requests and responses are raw distilled types; the image payload is returned as Blob (Uint8Array).

Provide the GetStaticMapHttp implementation layer on the Function effect (.pipe(Effect.provide(AWS.GeoMaps.GetStaticMapHttp))), bind in the init phase, then call the client at runtime.

// init
const getStaticMap = yield* AWS.GeoMaps.GetStaticMap();
// runtime — Center is "longitude,latitude"; FileName must be "map" or "map@2x"
const image = yield* getStaticMap({
FileName: "map",
Center: "-122.3493,47.6205",
Zoom: 12,
Width: 400,
Height: 300,
});
const bytes = image.Blob; // Uint8Array | undefined (PNG)