diff --git a/app/src/main/java/it/danieleverducci/nextcloudmaps/activity/mappicker/MapPickerActivity.java b/app/src/main/java/it/danieleverducci/nextcloudmaps/activity/mappicker/MapPickerActivity.java index 46aa7c3..52d2cea 100644 --- a/app/src/main/java/it/danieleverducci/nextcloudmaps/activity/mappicker/MapPickerActivity.java +++ b/app/src/main/java/it/danieleverducci/nextcloudmaps/activity/mappicker/MapPickerActivity.java @@ -108,9 +108,8 @@ public class MapPickerActivity extends AppCompatActivity { // Disable edit mode if ((ViewHolder.this).coordsEditMode) (ViewHolder.this).coordsEditMode(false); - // Convert XY coords to LatLng - Projection p = (ViewHolder.this).map.getProjection(); - IGeoPoint igp = p.fromPixels(event.getX(), event.getY()); + // Write coords on edittext + IGeoPoint igp = (ViewHolder.this).map.getMapCenter(); (ViewHolder.this).binding.latEt.setText(String.format(Locale.ENGLISH, "%.06f", igp.getLatitude())); (ViewHolder.this).binding.lonEt.setText(String.format(Locale.ENGLISH, "%.06f", igp.getLongitude())); return false;