integreat-cms icon indicating copy to clipboard operation
integreat-cms copied to clipboard

Enable setting POI position via drag & drop on map

Open MizukiTemma opened this issue 2 years ago • 1 comments

Short description

This PR enables users to set address and coordinates of POI by drag & drop of pin on the map.

Proposed changes

  • Set the map pin draggable.
  • After each drag&drop (change in coordinates) the address will be derived.
  • New address and coordinates are suggested, user can choose to update the both or one of them or to discard the change.
  • If it is a new POI and there is no address/coordinates, the map and pin show the center coordinates of the region.

Side effects

  • so far not found

Resolved issues

Fixes: #1035


Pull Request Review Guidelines

MizukiTemma avatar Oct 29 '22 11:10 MizukiTemma

Code Climate has analyzed commit e59561f6 and detected 2 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 2

The test coverage on the diff in this pull request is 23.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 74.2% (0.0% change).

View more on Code Climate.

codeclimate[bot] avatar Oct 29 '22 11:10 codeclimate[bot]

Works good! Thank you. One little improvement idea I got: may be "Discard" should be another button next to "Confirm"? Rather than radio option. Seems like more common UI to me.

That's a good idea 😃 I'll add a red button for it.

MizukiTemma avatar Nov 02 '22 14:11 MizukiTemma

2 fixes:

  1. Map preview is adjusted so it shows the last status when the discard button is clicked.
  2. The numbers after decimal point of the region central coordinates were rounded off and a wrong position was shown in the new poi when map is activaed. This is fixed too.

MizukiTemma avatar Nov 02 '22 16:11 MizukiTemma

@timoludwig Thank you for the improvement and explanation. It looks and works way better 😻

MizukiTemma avatar Nov 04 '22 23:11 MizukiTemma