Fixed coordinates mapping on map picker
This commit is contained in:
parent
d009237679
commit
d888485fc2
@ -108,9 +108,8 @@ public class MapPickerActivity extends AppCompatActivity {
|
|||||||
// Disable edit mode
|
// Disable edit mode
|
||||||
if ((ViewHolder.this).coordsEditMode)
|
if ((ViewHolder.this).coordsEditMode)
|
||||||
(ViewHolder.this).coordsEditMode(false);
|
(ViewHolder.this).coordsEditMode(false);
|
||||||
// Convert XY coords to LatLng
|
// Write coords on edittext
|
||||||
Projection p = (ViewHolder.this).map.getProjection();
|
IGeoPoint igp = (ViewHolder.this).map.getMapCenter();
|
||||||
IGeoPoint igp = p.fromPixels(event.getX(), event.getY());
|
|
||||||
(ViewHolder.this).binding.latEt.setText(String.format(Locale.ENGLISH, "%.06f", igp.getLatitude()));
|
(ViewHolder.this).binding.latEt.setText(String.format(Locale.ENGLISH, "%.06f", igp.getLatitude()));
|
||||||
(ViewHolder.this).binding.lonEt.setText(String.format(Locale.ENGLISH, "%.06f", igp.getLongitude()));
|
(ViewHolder.this).binding.lonEt.setText(String.format(Locale.ENGLISH, "%.06f", igp.getLongitude()));
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user