ExAws.Location.Maps (ex_aws_location v0.1.0)

Copy Markdown

API calls for Amazon Location Service Maps (the geo-maps API).

Map tiles, style descriptors, sprites, glyphs and static map images.

These operations return binary or non-JSON payloads, so the response is returned unparsed: {:ok, %{status_code: 200, headers: headers, body: body}}.

Every function returns an operation struct to be passed to ExAws.request/2.

Operations

  • get_glyphs - GetGlyphs
  • get_sprites - GetSprites
  • get_static_map - GetStaticMap
  • get_style_descriptor - GetStyleDescriptor
  • get_tile - GetTile

See https://docs.aws.amazon.com/location/latest/APIReference/API_Operations_Amazon_Location_Service_Maps_V2.html

Summary

Functions

GetGlyphs returns the map's glyphs.

GetSprites returns the map's sprites.

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.

GetStyleDescriptor returns information about the style.

GetTile returns a tile. Map tiles are used by clients to render a map. They're addressed using a grid arrangement with an X coordinate, Y coordinate, and Z (zoom) level.

Types

get_static_map_opts()

@type get_static_map_opts() :: [
  bounded_positions: String.t(),
  bounding_box: String.t(),
  center: String.t(),
  color_scheme: String.t(),
  compact_overlay: String.t(),
  crop_labels: boolean(),
  geo_json_overlay: String.t(),
  key: String.t(),
  label_size: String.t(),
  language: String.t(),
  padding: integer(),
  points_of_interests: String.t(),
  political_view: String.t(),
  radius: integer(),
  scale_bar_unit: String.t(),
  style: String.t(),
  zoom: number()
]

get_style_descriptor_opts()

@type get_style_descriptor_opts() :: [
  buildings: String.t(),
  color_scheme: String.t(),
  contour_density: String.t(),
  key: String.t(),
  poi_categories: [String.t()],
  poi_density: String.t(),
  political_view: String.t(),
  terrain: String.t(),
  traffic: String.t(),
  travel_modes: [String.t()]
]

get_tile_opts()

@type get_tile_opts() :: [additional_features: [String.t()], key: String.t()]

Functions

get_glyphs(font_stack, font_unicode_range)

@spec get_glyphs(String.t(), String.t()) :: ExAws.Operation.RestQuery.t()

GetGlyphs returns the map's glyphs.

For more information, see Style labels with glyphs in the Amazon Location Service Developer Guide.

Parameters

  • font_stack - Name of the FontStack to retrieve.

  • font_unicode_range - A Unicode range of characters to download glyphs for. This must be aligned to multiples of 256.

See https://docs.aws.amazon.com/location/latest/APIReference/API_geomaps_GetGlyphs.html

get_sprites(style, color_scheme, variant, file_name)

@spec get_sprites(String.t(), String.t(), String.t(), String.t()) ::
  ExAws.Operation.RestQuery.t()

GetSprites returns the map's sprites.

For more information, see Style iconography with sprites in the Amazon Location Service Developer Guide.

Parameters

  • style - Style specifies the desired map style for the Sprites APIs. Valid values: Standard, Monochrome, Hybrid, Satellite.

  • color_scheme - Sets the color tone for the map sprites, such as dark and light. Valid values: Light, Dark.

  • variant - Optimizes map styles for specific use case or industry. You can choose allowed variant only with Standard map style. Valid values: Default.

  • file_name - Sprites API: The name of the sprite file to retrieve, following pattern sprites(@2x)?\.(png|json).

See https://docs.aws.amazon.com/location/latest/APIReference/API_geomaps_GetSprites.html

get_static_map(file_name, height, width, opts \\ [])

@spec get_static_map(String.t(), integer(), integer(), get_static_map_opts()) ::
  ExAws.Operation.RestQuery.t()

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

  • file_name - The map scaling parameter to size the image, icons, and labels. It follows the pattern of ^map(@2x)?$.

  • height - Specifies the height of the map image.

  • width - Specifies the width of the map image.

Options

  • :bounded_positions - 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.

  • :bounding_box - 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.

  • :center - 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.

  • :color_scheme - Sets the color tone for the map, such as dark and light. Valid values: Light, Dark.

  • :compact_overlay - Takes in a string to draw geometries on the image. The input is a comma separated format as follows format: [Lon, Lat]

  • :crop_labels - 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 - Takes in a string to draw geometries on the image. The input is a valid GeoJSON collection object.

  • :key - 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 - Overrides the label size auto-calculated by FileName. Takes in one of the values - Small or Large. Valid values: Small, Large.

  • :language - 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.

  • :padding - Applies additional space (in pixels) around overlay feature to prevent them from being cut or obscured.

  • :points_of_interests - Determines if the result image will display icons representing points of interest on the map. Valid values: Enabled, Disabled.

  • :political_view - Specifies the political view, using ISO 3166-2 or ISO 3166-3 country code format.

  • :radius - 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.

  • :scale_bar_unit - Displays a scale on the bottom right of the map image with the unit specified in the input. Valid values: Kilometers, KilometersMiles, Miles, MilesKilometers.

  • :style - Style specifies the desired map style. Valid values: Satellite, Standard.

  • :zoom - Specifies the zoom level of the map image.

See https://docs.aws.amazon.com/location/latest/APIReference/API_geomaps_GetStaticMap.html

get_style_descriptor(style, opts \\ [])

@spec get_style_descriptor(String.t(), get_style_descriptor_opts()) ::
  ExAws.Operation.RestQuery.t()

GetStyleDescriptor returns information about the style.

For more information, see Style dynamic maps in the Amazon Location Service Developer Guide.

Parameters

  • style - Style specifies the desired map style. For GrabMaps customers, ap-southeast-1 and ap-southeast-5 regions support only the Standard and Monochrome values. Valid values: Standard, Monochrome, Hybrid, Satellite.

Options

  • :buildings - Adjusts how building details are rendered on the map. Valid values: Buildings3D.

  • :color_scheme - Sets the color tone for the map, such as dark and light. Valid values: Light, Dark.

  • :contour_density - Displays the shape and steepness of terrain features using elevation lines. The density value controls how densely the available contour line information is rendered on the map. Not supported in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers. Valid values: Low, Medium, High.

  • :key - Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a request.

  • :poi_categories - Renders only the specified categories of points of interest. When you omit this parameter, the map renders all categories. Valid values: FoodAndDrink, Entertainment, SightsAndMuseums, Transportation, Accommodations, LeisureAndOutdoor, Shopping, BusinessAndServices, FacilitiesAndBuildings.

  • :poi_density - Controls how densely points of interest are rendered on the map. The density value controls the zoom level at which each category of points of interest appears, and how quickly less prominent points of interest are revealed as you zoom in. Denser values display more points of interest at lower zoom levels. Valid values: Off, VerySparse, Sparse, Default, Dense, VeryDense.

  • :political_view - Specifies the political view using ISO 3166-2 or ISO 3166-3 country code format. Not supported in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers.

  • :terrain - Adjusts how physical terrain details are rendered on the map. Not supported in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers. Valid values: Hillshade, Terrain3D.

  • :traffic - Displays real-time traffic information overlay on map, such as incident events and flow events. Not supported in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers. Valid values: All, Congestion.

  • :travel_modes - Renders additional map information relevant to selected travel modes. Information for multiple travel modes can be displayed simultaneously, although this increases the overall information density rendered on the map. Not supported in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers. Valid values: Transit, Truck.

See https://docs.aws.amazon.com/location/latest/APIReference/API_geomaps_GetStyleDescriptor.html

get_tile(tileset, z, x, y, opts \\ [])

@spec get_tile(String.t(), String.t(), String.t(), String.t(), get_tile_opts()) ::
  ExAws.Operation.RestQuery.t()

GetTile returns a tile. Map tiles are used by clients to render a map. They're addressed using a grid arrangement with an X coordinate, Y coordinate, and Z (zoom) level.

For more information, see Tiles in the Amazon Location Service Developer Guide.

Parameters

  • tileset - Specifies the desired tile set. For GrabMaps customers, ap-southeast-1 and ap-southeast-5 regions support only the vector.basemap value.

  • z - The zoom value for the map tile.

  • x - The X axis value for the map tile.

  • y - The Y axis value for the map tile.

Options

  • :additional_features - A list of optional additional parameters such as map styles that can be requested for each result. Not supported in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers. Valid values: ContourLines, Hillshade, Logistics, Transit.

  • :key - Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a request.

See https://docs.aws.amazon.com/location/latest/APIReference/API_geomaps_GetTile.html