Prerequisites - Amazon Location Service

Prerequisites

Before you display a map in your application follow the prerequisite steps:

Create a map resource

To use a map in your application you must have a map resource, which specifies the map style and data provider to use in your maps.

Note

If your application is tracking or routing assets you use in your business, such as delivery vehicles or employees, you must not use Esri as your geolocation provider. See section 82 of the AWS service terms for more details.

You can create a map resource using the Amazon Location Service console, the AWS CLI, or the Amazon Location APIs.

Console
To create a map resource using the Amazon Location Service console
  1. In the Amazon Location console, on the Maps page, choose Create map to preview map styles.

  2. Add a name and description for the new map resource.

  3. Choose a map style.

    Note

    If your application is tracking or routing assets you use in your business, such as delivery vehicles or employees, you must not use Esri as your geolocation provider. See section 82 of the AWS service terms for more details.

  4. Choose from the Political views to use.

  5. Agree to the Amazon Location Terms and Conditions, then choose Create map. You can interact with the map that you've chosen: zoom in, zoom out, or pan in any direction.

  6. To allow your users to switch styles (for example, to allow them to switch between satellite imagery and vector style), you must create a map resource for each style.

    You can delete resources with map styles that you don’t want to use on the Maps home page in the console.

API

To create a map resource using the Amazon Location APIs

Use the CreateMap operation from the Amazon Location APIs.

The following example is an API request to create a map resource called ExampleMap using the VectorEsriStreets map style.

POST /maps/v0/maps HTTP/1.1 Content-type: application/json { "Configuration": { "Style": "VectorEsriStreets" }, "MapName": "ExampleMap" } }
Note

If your application is tracking or routing assets you use in your business, such as delivery vehicles or employees, you must not use Esri as your geolocation provider. See section 82 of the AWS service terms for more details.

AWS CLI

To create a map resource using AWS CLI commands

Use the create-map command.

The following example creates a map resource called ExampleMap using VectorEsriStreets as the map style.

aws location \ create-map \ --configuration Style="VectorEsriStreets" \ --map-name "ExampleMap"
Note

If your application is tracking or routing assets you use in your business, such as delivery vehicles or employees, you must not use Esri as your geolocation provider. See section 82 of the AWS service terms for more details.

Authenticating your requests

Once you create a map resource and you're ready to begin building location features into your application, you need to choose how you would authenticate your requests.

Note

Most maps front end applications require unauthenticated access to the maps or other features of Amazon Location Service. Depending on your application, you might want to use AWS Signature v4 to authenticate requests, or you can use Amazon Cognito or Amazon Location API keys for unauthenticated use. To learn more about all of these options, see Granting access to Amazon Location Service.