Sometimes you need to translate a coordinate into a human-readable street address. This is often used in tracking applications that receive a GPS feed from a device or asset and need to obtain the corresponding address. The reverse geocoding endpoint returns the address information described in the Reverse Geocoding API documentation on the Developer Portal.
Sample use case: You want to know the address of a place on the map. You press your finger on the map display and address information appears in a balloon on the screen. Use the following code to try this in your app:
SearchApi searchAPI = createSearchAPI(); ReverseGeocoderSearchQuery reverseGeocoderQuery = createReverseGeocoderQuery(latLng); searchAPI.reverseGeocoding(reverseGeocoderQuery, revGeoSearchCallback);
val revGeoQuery = ReverseGeocoderSearchQueryBuilder(latLng.latitude, latLng.longitude).build() searchApi.reverseGeocoding(revGeoQuery)