In November 2024, Amazon Location Service v2 was finally released!
You can find out more in this article, so please check it out.
Building a Map Application with Amazon Location Service v2 and MapLibre GL JS
Yasunori Kirimoto for AWS Heroes γ» Nov 18
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. πΊοΈ
https://x.com/dayjournal_nori/status/1855029985108795676
Advance Preparation
Create an API key for Amazon Location Service v2
Amazon Location Service #007 - API Key Creation (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.
https://maps.geo.ap-northeast-1.amazonaws.com/v2/static/map?&style=Satellite&scale-unit=Kilometers¢er=139.767,35.681&width=1024&height=1024&zoom=14&key=v1.public.xxxxx
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.
https://maps.geo.ap-northeast-1.amazonaws.com/v2/static/map?&style=Satellite&scale-unit=Kilometers¢er=139.767,35.681&width=1024&height=1024&zoom=16&key=v1.public.xxxxx
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.
https://maps.geo.ap-northeast-1.amazonaws.com/v2/static/map?&style=Satellite&scale-unit=Kilometers¢er=139.767,35.681&width=1024&height=1024&zoom=16&compact-overlay=point:139.767,35.681;label=Tokyo Station;size=large&key=v1.public.xxxxx
CompactOverlay: compact-overlay=
Point: point:139.767,35.681;
Label: label=Tokyo Station;
Size: size=large
Related Articles
Building a Map Application with Amazon Location Service v2 and MapLibre GL JS
Yasunori Kirimoto for AWS Heroes γ» Nov 18
Building an Amazon Location Service Resources with AWS CDK and AWS CloudFormation
Yasunori Kirimoto for AWS Heroes γ» Apr 2
Trying to display an Amazon Location Service map in QGIS
Yasunori Kirimoto for AWS Heroes γ» Sep 4 '23
Use 3D map library with API key function of Amazon Location Service
Yasunori Kirimoto for AWS Heroes γ» Aug 2 '23
Amazon Location Service and AWS Amplify to Use Various Map Library
Yasunori Kirimoto for AWS Heroes γ» Jan 5 '23
References
Amazon Location Service
Top comments (0)