get_static_map
async
¶
get_static_map(
height: SensitiveInteger,
file_name: str,
width: SensitiveInteger,
*,
config_overrides: Optional[AsyncGeoMapsClientConfig] = None,
bounding_box: Optional[PositionListString] = None,
bounded_positions: Optional[PositionListString] = None,
center: Optional[PositionString] = None,
color_scheme: Optional[ColorScheme] = None,
compact_overlay: Optional[CompactOverlay] = None,
crop_labels: Optional[bool] = None,
geo_json_overlay: Optional[GeoJsonOverlay] = None,
key: Optional[ApiKey] = None,
label_size: Optional[LabelSize] = None,
language: Optional[LanguageTag] = None,
padding: Optional[SensitiveInteger] = None,
political_view: Optional[CountryCode] = None,
points_of_interests: Optional[MapFeatureMode] = None,
radius: Optional[DistanceMeters] = None,
scale_bar_unit: Optional[ScaleBarUnit] = None,
style: Optional[StaticMapStyle] = None,
zoom: Optional[SensitiveFloat] = None,
) -> GetStaticMapResponse
GetStaticMap provides high-quality static map images with customizable options. You can modify the map's appearance and overlay additional information. It's an ideal solution for applications requiring tailored static map snapshots. Not supported in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers.
For more information, see the following topics in the Amazon Location Service Developer Guide:
Parameters:
-
bounding_box(Optional[PositionListString], default:None) –Takes in two pairs of coordinates in World Geodetic System (WGS 84) format: [longitude, latitude], denoting south-westerly and north-easterly edges of the image. The underlying area becomes the view of the image.
Example: -123.17075,49.26959,-123.08125,49.31429
-
bounded_positions(Optional[PositionListString], default:None) –Takes in two or more pair of coordinates in World Geodetic System (WGS 84) format: [longitude, latitude], with each coordinate separated by a comma. The API will generate an image to encompass all of the provided coordinates.
Cannot be used with
Zoomand orRadiusExample: 97.170451,78.039098,99.045536,27.176178
-
center(Optional[PositionString], default:None) –Takes in a pair of coordinates in World Geodetic System (WGS 84) format: [longitude, latitude], which becomes the center point of the image. This parameter requires that either zoom or radius is set.
Cannot be used with
Zoomand orRadiusExample: 49.295,-123.108
-
color_scheme(Optional[ColorScheme], default:None) –Sets the color tone for the map, such as dark and light.
Example:
LightDefault value:
LightValid values for
ColorSchemeare case sensitive. -
compact_overlay(Optional[CompactOverlay], default:None) –Takes in a string to draw geometries on the image. The input is a comma separated format as follows format:
[Lon, Lat]Example:
line:-122.407653,37.798557,-122.413291,37.802443;color=%23DD0000;width=7;outline-color=#00DD00;outline-width=5yd|point:-122.40572,37.80004;label=Fog Hill Market;size=large;text-color=%23DD0000;color=#EE4B2BCurrently it supports the following geometry types: point, line and polygon. It does not support multiPoint , multiLine and multiPolgyon.
-
crop_labels(Optional[bool], default:None) –It is a flag that takes in true or false. It prevents the labels that are on the edge of the image from being cut or obscured.
-
geo_json_overlay(Optional[GeoJsonOverlay], default:None) –Takes in a string to draw geometries on the image. The input is a valid GeoJSON collection object.
Example:
{"type":"FeatureCollection","features": [{"type":"Feature","geometry":{"type":"MultiPoint","coordinates": [[-90.076345,51.504107],[-0.074451,51.506892]]},"properties": {"color":"#00DD00"}}]} -
height(SensitiveInteger) –Specifies the height of the map image.
-
key(Optional[ApiKey], default:None) –Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a request.
-
label_size(Optional[LabelSize], default:None) –Overrides the label size auto-calculated by
FileName. Takes in one of the values -SmallorLarge. -
language(Optional[LanguageTag], default:None) –Specifies the language on the map labels using the BCP 47 language tag, limited to ISO 639-1 two-letter language codes. If the specified language data isn't available for the map image, the labels will default to the regional primary language.
Supported codes:
-
ar -
as -
az -
be -
bg -
bn -
bs -
ca -
cs -
cy -
da -
de -
el -
en -
es -
et -
eu -
fi -
fo -
fr -
ga -
gl -
gn -
gu -
he -
hi -
hr -
hu -
hy -
id -
is -
it -
ja -
ka -
kk -
km -
kn -
ko -
ky -
lt -
lv -
mk -
ml -
mr -
ms -
mt -
my -
nl -
no -
or -
pa -
pl -
pt -
ro -
ru -
sk -
sl -
sq -
sr -
sv -
ta -
te -
th -
tr -
uk -
uz -
vi -
zh
-
-
padding(Optional[SensitiveInteger], default:None) –Applies additional space (in pixels) around overlay feature to prevent them from being cut or obscured.
Value for max and min is determined by:
Min:
1Max:
min(height, width)/4Example:
100 -
political_view(Optional[CountryCode], default:None) –Specifies the political view, using ISO 3166-2 or ISO 3166-3 country code format.
The following political views are currently supported:
-
ARG: Argentina's view on the Southern Patagonian Ice Field and Tierra Del Fuego, including the Falkland Islands, South Georgia, and South Sandwich Islands -
EGY: Egypt's view on Bir Tawil -
IND: India's view on Gilgit-Baltistan -
KEN: Kenya's view on the Ilemi Triangle -
MAR: Morocco's view on Western Sahara -
RUS: Russia's view on Crimea -
SDN: Sudan's view on the Halaib Triangle -
SRB: Serbia's view on Kosovo, Vukovar, and Sarengrad Islands -
SUR: Suriname's view on the Courantyne Headwaters and Lawa Headwaters -
SYR: Syria's view on the Golan Heights -
TUR: Turkey's view on Cyprus and Northern Cyprus -
TZA: Tanzania's view on Lake Malawi -
URY: Uruguay's view on Rincon de Artigas -
VNM: Vietnam's view on the Paracel Islands and Spratly Islands
-
-
points_of_interests(Optional[MapFeatureMode], default:None) –Determines if the result image will display icons representing points of interest on the map.
-
radius(Optional[DistanceMeters], default:None) –Used with center parameter, it specifies the zoom of the image where you can control it on a granular level. Takes in any value
>= 1.Example:
1500Cannot be used with
Zoom.Unit:
Meters -
file_name(str) –The map scaling parameter to size the image, icons, and labels. It follows the pattern of
^map(@2x)?$.Example:
map, map@2x -
scale_bar_unit(Optional[ScaleBarUnit], default:None) –Displays a scale on the bottom right of the map image with the unit specified in the input.
Example:
KilometersMiles, Miles, Kilometers, MilesKilometers -
style(Optional[StaticMapStyle], default:None) –Stylespecifies the desired map style. -
width(SensitiveInteger) –Specifies the width of the map image.
-
zoom(Optional[SensitiveFloat], default:None) –Specifies the zoom level of the map image.
Cannot be used with
Radius.
Raises:
-
AccessDeniedException–The request was denied because of insufficient access or permissions. Check with an administrator to verify your permissions.
-
InternalServerException–The request processing has failed because of an unknown error, exception or failure.
-
ThrottlingException–The request was denied due to request throttling.
-
ValidationException–The input fails to satisfy the constraints specified by an AWS service.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_geo_maps/_services/async_geo_maps.py
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 | |