Android google map - get map click location when marker clicked -


i've got map plenty of large custom markers on it. want allow user create path on map (displayed polyline , later saved list of geocoordinate pairs).

if user clicks on map can collect these positions setonmapclickedlistener method of map. if user clicks on marker (setonmarkerclickedlistener), can retrieve markers position (generally position of ancor of marker).

is possible somehow retrieve clicked map location when marker clicked?

i'm using supportmapfragment.

try below

        mmap.setonmarkerclicklistener(new onmarkerclicklistener() {             @override             public boolean onmarkerclick(marker marker) {                 latlng position = marker.getposition();                  toast.maketext(                                 mainactivity.this,                                 "lat " + position.latitude + " "                                         + "long " + position.longitude,                                 toast.length_long).show();                 return true;             }         }); 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -