AWS Community Builder map implemented via AWS Location Services
- Need an AWS Account and a user/role with admin privileges
- Python 3.8 for geocoding script
- A modern browser to display the map
- A newline separated file contains a list of locations to geocode
- Create a Cognito Identity Pool for anonymous access and getting credentials that support read-only access for retrieving tiles.
- Create an Amazon Location Service Map resource to support retrieving tiles.
- Create an Amazon Location Service Place Index resource to support geocoding.
To run the geocoding script, ensure you have the requirements installed.
$ cd geocode
$ pip install -r requirements.txt
Open the geocode.py
file and update the INDEX_NAME
and INPUT_FILE_NAME
with the values of your input file (newline separated list of locations) and the AWS Location Services Place Index name that you created as part of the Prerequisites.
Since the inputs are hardcoded at the top of the script, simply run the script with python and it will generate the data.geojson
needed by the map page.
$ python geocode.py
Note the Cognito Identity Pool ID and the AWS Location Service Map name that you created as part of the Prerequisites. Open the index.html
and find the lines contains <REPLACE
and update the value of the two fields with the Cognito Identity Pool ID and the map name.
Assuming you have run the geocoding script (i.e. the data.geojson
file is present in the root directory) and you have updated the index.html
with your resource names: you should be able to open the index.html
file with a modern browser and see the markers displayed on the map :)
This static map is hosted at the following location and currently displays the country locations of the 2300+ AWS Community Builders as of September 2022.