I set the marker and dragged it to true. But when I call marker.getPosition() , I always get the same location, since the position of the marker is not updated after the end is complete.
mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map_place)) .getMap(); LatLng MYLOCATION = new LatLng(Double.valueOf(myLat), Double.valueOf(myLng)); marker = new MarkerOptions() .position(MYLOCATION) .title(getString(R.string.map_title_my_location)).draggable(true); mMap.addMarker(marker).showInfoWindow(); mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(MYLOCATION, 18)); close.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) {
how the vars I classes are defined:
GoogleMap mMap; MarkerOptions marker;
Any idea ?!
source share