How to place marker on point tapped in google maps api v2? -


how can declare latlng point in map activity, when users taps on specific point on map place marker. have done create map can add custom marker camera intent ond place on map. problem isn't fact works, fact have declare 'point' coordinates on map when the image taken place thumbnail of image @ point.

example: static final latlng point = new latlng(xx.xxxx, xx.xxxx);

and in onactivityresult camera intent:

 markeroptions markeroptions = new markeroptions()     .position(point)     .icon(bitmapdescriptorfactory     .frombitmap(bitmap));     googlemap.addmarker(markeroptions); 

so want listen user has tapped , return image point tapped.

could please help? if need more info please let me know , update question.

thanks

updated code

 @override   public void onmapclick(latlng point) {            root = environment.getexternalstoragedirectory().tostring()           + "/your_folder";           imagefolderpath = root + "/saved_images";           file imagesfolder = new file(imagefolderpath);           imagesfolder.mkdirs();           imagename = "test.png";           file image = new file(imagefolderpath, imagename);            fileuri = uri.fromfile(image);            intent takepictureintent = new intent(mediastore.action_image_capture);            takepictureintent.putextra(mediastore.extra_output, fileuri);            startactivityforresult(takepictureintent,                   camera_image_request);        }     protected void onactivityresult(int requestcode, int resultcode, intent data, latlng point) {           // todo auto-generated method stub           super.onactivityresult(requestcode, resultcode, data);            if (resultcode == result_ok) {                switch (requestcode) {               case camera_image_request:                    bitmap bitmap = null;                   try {                       getimagethumbnail getimagethumbnail = new getimagethumbnail();                       bitmap = getimagethumbnail.getthumbnail(fileuri, this);                   } catch (filenotfoundexception e1) {                       e1.printstacktrace();                   } catch (ioexception e1) {                       e1.printstacktrace();                   }                    markeroptions markeroptions = new markeroptions()                   .position(point)                   .icon(bitmapdescriptorfactory                   .frombitmap(bitmap));                   googlemap.addmarker(markeroptions);                    break;                default:                   toast.maketext(this, "something went wrong...",                           toast.length_short).show();                   break;               }            }       }       public void showfullimage(view view) {             string path = (string) view.gettag();              if (path != null) {                  intent intent = new intent();                 intent.setaction(intent.action_view);                 uri imguri = uri.parse("file://" + path);                 intent.setdataandtype(imguri, "image/*");                 startactivity(intent);              } 

i think need onmapclicklistener

you have need in documentation working


Comments

Popular posts from this blog

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -