How to get the latitude and longitude of location where user taps on the map in android

Suresh Basina

In my Android application, I'm using google maps v2 to show map by getting the latitute and longitude of the device's current location And I'm showing pin on that location.

Now when user clicks or taps on any other location on the map, then I have to get that points latitude and longitude and i have to set the pin at that location.

Could you please tell me how get the latitude and longitude of the user taps/clicks location.

Antonis Lambrianides

An example of what i use. Change it accordingly for your needs. I use it with long press.

map.setOnMapLongClickListener(new OnMapLongClickListener() {
            @Override
            public void onMapLongClick(LatLng point) {
                    map.addMarker(new MarkerOptions().position(point).title("Custom location").icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED)));enter code here
            }
        });

the LatLng point contains the coordinated of the longpress

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to get the latitude and longitude of location where user taps on the map in android

From Java

How to get the current location latitude and longitude in android

From Dev

How to get photo location by latitude and longitude in android?

From Java

How to get address location from latitude and longitude in Google Map.?

From Dev

How to get latitude and longitude of a user's location in iOS

From Dev

not get the value of latitude and longitude in google map in android

From Dev

How to get the latitude & longitude of a touch location on mapView using Google map API in iOS

From Dev

Find closest longitude and latitude in array from user location - Android Studio

From Dev

How to draw the map my current location to particular latitude longitude values

From Dev

How to obtain latitude and longitude of a user by IP address or pinpoint location

From Dev

How to restrict user login based on location latitude longitude

From Dev

How to Get City Name by Latitude &Longitude in android?

From Dev

How to Get City Name by Latitude &Longitude in android?

From Dev

How to get city information in android by longitude and latitude

From Dev

How to get address of a location from latitude longitude values using geocoder in android?

From Dev

How to get Current GPS location(latitude-longitude) using Google API in Android App?

From Dev

How to get latitude and longitude of my current location in android ? (Not with GPS but with internet service)

From Dev

Get current location latitude and longitude for API 23 and above in Android

From Dev

Can't Get GPS Current Location's Latitude and Longitude Android

From Java

How to get a time zone from a location using latitude and longitude coordinates?

From Dev

How to get location name from latitude and longitude using javascript?

From Dev

How to get the latitude and longitude of current device location in C#

From Dev

How to get longitude and latitude in mapbox after detect current location?

From Dev

how to get location using Latitude and Longitude in windows phone 8

From Dev

How to get location name from latitude and longitude using javascript?

From Dev

How can I get accurate latitude/longitude of current GPS location?

From Dev

How to get current location name from longitude and latitude?

From Dev

How to get exact view that is set using Latitude and Longitude in android google map

From Dev

How to get address from latitude and longitude android google map v2

Related Related

  1. 1

    How to get the latitude and longitude of location where user taps on the map in android

  2. 2

    How to get the current location latitude and longitude in android

  3. 3

    How to get photo location by latitude and longitude in android?

  4. 4

    How to get address location from latitude and longitude in Google Map.?

  5. 5

    How to get latitude and longitude of a user's location in iOS

  6. 6

    not get the value of latitude and longitude in google map in android

  7. 7

    How to get the latitude & longitude of a touch location on mapView using Google map API in iOS

  8. 8

    Find closest longitude and latitude in array from user location - Android Studio

  9. 9

    How to draw the map my current location to particular latitude longitude values

  10. 10

    How to obtain latitude and longitude of a user by IP address or pinpoint location

  11. 11

    How to restrict user login based on location latitude longitude

  12. 12

    How to Get City Name by Latitude &Longitude in android?

  13. 13

    How to Get City Name by Latitude &Longitude in android?

  14. 14

    How to get city information in android by longitude and latitude

  15. 15

    How to get address of a location from latitude longitude values using geocoder in android?

  16. 16

    How to get Current GPS location(latitude-longitude) using Google API in Android App?

  17. 17

    How to get latitude and longitude of my current location in android ? (Not with GPS but with internet service)

  18. 18

    Get current location latitude and longitude for API 23 and above in Android

  19. 19

    Can't Get GPS Current Location's Latitude and Longitude Android

  20. 20

    How to get a time zone from a location using latitude and longitude coordinates?

  21. 21

    How to get location name from latitude and longitude using javascript?

  22. 22

    How to get the latitude and longitude of current device location in C#

  23. 23

    How to get longitude and latitude in mapbox after detect current location?

  24. 24

    how to get location using Latitude and Longitude in windows phone 8

  25. 25

    How to get location name from latitude and longitude using javascript?

  26. 26

    How can I get accurate latitude/longitude of current GPS location?

  27. 27

    How to get current location name from longitude and latitude?

  28. 28

    How to get exact view that is set using Latitude and Longitude in android google map

  29. 29

    How to get address from latitude and longitude android google map v2

HotTag

Archive