问题
The Android Placepicker is deprecated since last month. How do i get or build a simple lat/long coordinates (place-)picker with the "new" Google Maps Platform (API)?
回答1:
Here's a codelab for building a place picker from scratch with nearbyPlaces query:
https://codelabs.developers.google.com/codelabs/location-places-android/
回答2:
Here is what i did.
I have used this tutorial to implement the mapView.
CodeLab Tutorial Link: https://codelabs.developers.google.com/codelabs/location-places-android/
But the above codelab does not allows user to move/drag the marker on map or select a definite location. It just lists all the nearby places to user's current location.
Link to my Solution: [SOLVED]How to Implement Place Picker in Android App after Deprecation of previous Maps SDK
Using my implementation,
- user can get a mapView working
- user can press a button to geolocate their current location
- user can long-press on red-marker to move it on the map
- on clicking the Button below mapView, it will return the exact co-ordinates of the place on which the marker is placed.
来源:https://stackoverflow.com/questions/57414445/android-placepicker-2019