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.
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
-
In the Amazon Location console, on the Maps page, choose
Create map to preview map styles.
-
Add a name and description for the new map resource.
-
Choose a map style.
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.
-
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.
-
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
"
}
}
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
"
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, choose how you would authenticate your
requests: