0

I am using android here maps SDK, On long press, I will receive PointF (can be converted to geocoordinates) after that, I want to show in that long press location a bubble with the address of that location street name, Pincode, country something like that,

How can I achieve this?

 @Override
        public boolean onLongPressEvent(PointF pointF) {
            if (null != mMap) {
                // Converting pointF to GeoCoordinate
                GeoCoordinate longPressPointGeoCoordinate = mMap.pixelToGeo(pointF);
                showinfo();

            }
    }
Abu Yousuf
  • 5,729
  • 3
  • 31
  • 50

1 Answers1

0

Use ReverseGeocodeRequest class for get Address from GeoCoordinate

  /* Create a ReverseGeocodeRequest object with a GeoCoordinate. */

    GeoCoordinate coordinate = new GeoCoordinate(49.25914, -123.00777);
    ReverseGeocodeRequest revGecodeRequest = new ReverseGeocodeRequest(coordinate);
    revGecodeRequest.execute(new ResultListener<Location>() {
        @Override
        public void onCompleted(Location location, ErrorCode errorCode) {
            if (errorCode == ErrorCode.NONE) {
                /*
                 * From the location object, we retrieve the address and display to the screen.
                 * Please refer to HERE Android SDK doc for other supported APIs.
                 */
                String address = location.getAddress().toString();
            } else {
                // error
            }
        }
    });
Abu Yousuf
  • 5,729
  • 3
  • 31
  • 50