AWS Logo
Menu
Create Map Images Using the Static Map Function of Amazon Location Service v2

Create Map Images Using the Static Map Function of Amazon Location Service v2

I tried the static map function of Amazon Location Service v2.

Published Nov 25, 2024
In November 2024, Amazon Location Service v2 was finally released!
You can find out more in this article, so please check it out.
This article will introduce how to use the static map (GetStaticMap) in the Maps API. This function was newly added with Amazon Location Service v2, and you can create map images with the specified parameters.
The thread I posted on X also summarizes the recommended points of v2. 🗺️

Advance Preparation

Create an API key for Amazon Location Service v2

How to use the static map

Using the static map function of Amazon Location Service v2, you can easily create map images that can be used for various purposes, such as storing maps and reports, simply by specifying parameters in the URL. As of November 2024, the available map styles are limited to "Satellite," but there is also the possibility that new styles will be added. Here, we will introduce some examples of basic parameters, but many more are available. Please try customizing them.

Creating a basic map image

As a basic example, we will create a map of the area around Tokyo Station with a zoom level of 14, an image size of 1024px, and a scale bar included.
Endpoint: https://maps.geo.${region}.amazonaws.com/v2/static/
FileName: map
Style: style=Satellite
ScaleBarUnit: scale-unit=Kilometers
Center: center=139.767,35.681
Width: width=1024
Height: height=1024
Zoom: zoom=14
API key: key=v1.public.xxxxx

Create a zoomed in map image

Next, let's create a map image with the zoom level increased from 14 to 16, using the basic example.
Zoom: zoom=16

Create a map image with added point information

Finally, create a map image with added point information as an overlay. If it is a simple object, you can add it by specifying the parameters.
CompactOverlay: compact-overlay=
Point: point:139.767,35.681;
Label: label=Tokyo Station;
Size: size=large

Comments