Prerequisites - Amazon Location Service

Prerequisites

Before you begin displaying maps, follow the prerequisite steps:

Create a map resource

Before you can display an interactive map, begin by creating a map resource. You can do this using the Amazon Location Service console, the AWS CLI, or the Amazon Location APIs:

Important

Tangram styles are only compatible with Amazon Location map resources configured with the VectorHereBerlin map style.

Console

To create a map resource using the Amazon Location console

  1. Open the Amazon Location Service console at https://console.aws.amazon.com/location/.

  2. In the left navigation pane, choose Maps.

  3. Choose Create map.

  4. Fill out the following boxes:

    • Name – Enter a unique name. For example, ExampleMap. Maximum 100 characters. Valid entries include alphanumeric characters, hyphens, periods, and underscores.

    • Description – Enter an optional description to differentiate your resources.

  5. Under Maps, choose an available map style from a data provider.

  6. Under Pricing Plan, choose answers that best fit how you intend to use your map tiles.

    • For Mobile Asset Tracking or Mobile Asset Management pricing plans, you must associate at least one tracker and send at least one location update per month.

  7. (Optional) Under Tags, enter a tag Key and Value. This adds a tag your new map resource. For more information, see Tagging your resources.

  8. Choose Create map.

API

To create a map resource using the Amazon Location APIs

Use the CreateMap operation from the Amazon Location Maps APIs.

The following example is an API request to create a map resource called ExampleMap using the VectorEsriNavigation map style, and a request-based usage pricing plan.

POST /maps/v0/maps Content-type: application/json { "Configuration": { "Style": "VectorEsriNavigation" }, "Description": "Esri Dark Gray Canvas", "MapName": "ExampleMap", "PricingPlan": "RequestBasedUsage", "Tags": { "Tag1" : "Value1" } }
AWS CLI

To create a map resource using AWS CLI commands

Use the create-map command.

The following example is an AWS CLI to create a map resource called ExampleMap using the VectorEsriNavigation map style, and a request-based usage pricing plan.

aws location \ create-map \ --map-name "ExampleMap" \ --configuration "Style=VectorEsriNavigation" \ --pricing-plan "RequestBasedUsage" \ --tags Tag1=Value1
Note

Billing depends on your pricing plan and usage. You may incur fees for the use of other AWS services. For more information, see Amazon Location Service pricing.

Authenticating your requests

Once you create a map resource and you're ready to display a map in your application, choose how you would authenticate your requests:

  • To explore ways you can access the services, see Accessing Amazon Location Service.

  • If you have a website with anonymous users, or you want to use your own authentication process, or combine multiple authentication methods, see Allowing unauthenticated guest access to your application using Amazon Cognito.

    Example

    The following example shows the passing of the unauthenticated identity pool as credentials when using the AWS JavaScript SDK.

    const AWS = require("aws-sdk"); const credentials = new AWS.CognitoIdentityCredentials({ IdentityPoolId: "us-east-1:54f2ba88-9390-498d-aaa5-0d97fb7ca3bd" }); const client = new AWS.Location({ credentials, region: AWS.config.region || "<region>" }); console.log(await client.getMapStyleDescriptor("ExampleMap").promise());