How to get the latitude and longitude of location where user taps on the map in android -
in android application, i'm using google maps v2 show map getting latitute , longitude of device's current location , i'm showing pin on location.
now when user clicks or taps on other location on map, have points latitude , longitude , have set pin @ location.
could please tell me how latitude , longitude of user taps/clicks location.
an illustration of use. alter accordingly needs. utilize 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 coordinated of longpress
android google-maps latitude-longitude
No comments:
Post a Comment