Amazon Maps API Overview (v2.5)
With the Amazon Maps API, you can create tablet apps with high-quality maps that allow fluid zooming and panning, among other mapping features.
- Mapping Features
- Fire OS Version Requirements and API Levels
- Download the Amazon Maps SDK (v2.5)
- Moving the Map Camera
- Displaying the User's Location
- Drawing Objects on the Map
- Next Steps
The following is a list of the most important Amazon Maps API features:
- Display high-quality vector maps with fluid zooming and panning
- Display standard and satellite map tiles
- Use Fragments
- Display location data
- Handle user interaction with the map
- Add markers to show a specific locations on the map
- Draw polylines to connect two or more locations
- Draw polygons to highlight a neighborhood or circle an area
The following is a sample map embedded in a tablet app:
To display an Amazon map in an
Activity, you use the
MapFragment class or the
SupportMapFragment class. Once a map displays, users can pan, zoom, rotate, and tilt it using touch gestures.
You can set several options for the map, such as map type, enable/disable gestures for manipulating the map (rotating, scrolling, and tilting), and control the display of UI elements (zoom buttons and compass button).
To manipulate the map, you retrieve an
AmazonMap object from the
AmazonMap class is the primary class for working with the map.
AmazonMapOptions to set the initial map settings, either in the XML layout or in code.
Fire OS Version Requirements and API Levels
All Fire tablets (7th Generation and later) running FireOS 5+ support the Maps API v2.5. You can see a list of all Fire tablets and their Fire OS versions in Identifying Fire Tablet Devices.
The current minimum supported API level for Amazon Maps is API level 21. Any Fire tablets with earlier API levels (e.g., < 21) can't support the Amazon Maps API.
Download the Amazon Maps SDK (v2.5)
You can download the Amazon Maps SDK (v2.5) here:
The SDK file contains an Android Archive file (AAR), Maven POM file, reference documentation, and examples. You can also download this same file on the SDK Downloads page.
Moving the Map Camera
The map camera determines the area of the world shown by the map.
- The camera target is the latitude and longitude position at the center of the map.
- The camera zoom level sets the scale of the displayed area. As the number becomes larger, the camera moves closer to the earth to show smaller areas in greater detail.
- The camera bearing sets the orientation of the map. Bearing is measured in degrees and works similar to compass bearings. For example, setting bearing to 0 orients the map with North at the top, while setting the bearing to 270 rotates the map to position due West at the top.
- The camera tilt is the angle of the camera in relation to the earth.
CameraPosition attributes of the
AmazonMap contain information about the current camera position.
To move the camera to a new position, you must create a
CameraUpdate object that specifies the new location, zoom, bearing, and/or tilt and pass it to the
Displaying the User's Location
You can automatically add the user's current location and a "locate" button by turning on the my location layer with
Drawing Objects on the Map
Mapping apps commonly draw objects on the map, such as markers indicating points of interest or destinations, lines representing routes, and other shapes.
You can add markers to the map by defining the marker location and other properties in a
MarkerOptions object and then calling
AmazonMap.addMarker(). Markers can use custom icons and colors.
Lines and Shapes
You can add lines and shapes to the map. Similar to markers, you set the initial settings for the shape with an
Options object, then call an
add method to draw the shape. You can add:
- Lines, defined by a series of points (
- Circles, defined with a center and a radius (
- Polygons, defined by a series of at least three points connected by lines (