Developer Console
Vielen Dank für deinen Besuch. Diese Seite ist nur in Englisch verfügbar.

Differences between the Amazon Maps API and Google Maps API (v2.0 - Deprecated)

The Amazon Maps API offers interface parity with version 2 of the Google Maps API. Most classes and method calls in your Google Maps–compatible app work the same on Amazon devices.

However, there are some features that are not supported. In these cases, the Amazon Maps API includes stub methods, but they do not function.

Unsupported Features

The following features are not available in Amazon Maps:

Feature Related Methods and Classes
Indoor Maps The .setIndoorEnabled() and .isIndoorEnabled() methods always return false. The .getFocusedBuilding() method returns null, and the callback methods defined in the OnIndoorStateChangeListener interface are never called.
Street View The API provides stubs for the street view classes and methods. All street view methods return null or throw an UnsupportedOperationException.
Flat markers Flat markers are not supported. Setting Marker.setFlat() or MarkerOptions.isFlat() to true has no effect on the display of the marker.
Draggable Markers Dragging markers is not supported. Setting Marker.setDraggable() or MarkerOptions.isDraggable() to true has no effect on the marker. Also, the callback methods defined in the OnMarkerDragListener interface are never called.
Large font support Enabling the large font option on the device does not change the text size of map labels.
Lite Mode API The Lite mode methods are not supported. Calling the AmazonMapOptions.liteMode() has no effect.

Using Strict Mode to Identify the Use of Unsupported Features

Normally, calling the methods for unsupported features has no effect. The method silently fails. For example, calling Marker.setFlat(true) does not change the appearance of the marker displayed on the map.

You can optionally turn on strict mode. Strict mode causes these methods to log warnings or throw exceptions instead of silently failing. This can be useful during testing for detecting any unsupported features your app is using.

To enable strict mode, add the following XML to your app's AndroidManifest.xml, within the applications element:

      android:value="strictModeLevel" />

Set the strictModeLevel to one of these values:

  • log — Calling an unsupported method logs a warning in LogCat.
  • throw — Calling an unsupported method throws a StrictModeException.
  • log,throw — Calling an unsupported method logs a warning in LogCat and throws the StrictModeException.

The strict-mode option applies to all of the methods for unsupported features noted above.

To disable strict mode, completely remove the meta-data element containing amazon.maps.strictmode.ApiPolicy from your manifest file.

For example, the following code adds a marker at the geographic location (latitude / longitude) represented by point to the map referenced by mMap:

MarkerOptions opt = new MarkerOptions()
    .title("New Marker")

Marker m = mMap.addMarker(opt);

When strict mode is not enabled, this code runs normally and places the marker at the location specified by point. The .draggable option is set to true, but since this feature is not supported, this has no effect on the marker.

When strict mode is enabled with the log option, the above code adds the marker normally, but also generates a message in the LogCat:

D/MapsApi-Strict(18307): MAPS API STRICT MODE VIOLATION: Draggable markers are not supported in this release of AmazonMaps.

When strict mode is enabled with the throw option, the above code throws a StrictModeException exception for attempting to set .draggable to true.

Because strict mode detects unsupported features during testing, you can decide the best way to work around those features before releasing your app.

Deprecated Location APIs

The Amazon Maps v2 API includes the following location APIs for compatibility with the Google Maps API:

  • getMyLocation()
  • AmazonMap.OnMyLocationChangeListener

Although these calls work, they are deprecated. Instead, use the standard Android location APIs (android.location) to work with locations. For additional details, see Location Strategies.

Next Steps

To learn how to migrate your app from the Google Maps API to the Amazon Maps API, see Migrating an App from Google Maps v2.

For information about registering your app for map tiles and testing your app, see Registering and Testing Your Amazon Maps API v2  App.

To learn more about performing common tasks in the Amazon Maps API, see Understanding the Amazon Maps API v2.

For additional help and information, see the Amazon Maps API Frequently Asked Questions.