Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/workingdog/mappoly

An interactive polygon on a SwiftUI Map
https://github.com/workingdog/mappoly

Last synced: about 5 hours ago
JSON representation

An interactive polygon on a SwiftUI Map

Awesome Lists containing this project

README

        

# Draw a polygon on SwiftUI Map

This is my SwiftUI test code to draw an interactive polygon on a Map.

## Usage

### Add

To add a new polygon, click the `Add` button then click the map to add points.

You need **at least 3 points** to form a polygon.

Click the `Add` button again to deactivate adding more points.

**Tip**, it is often easier to just roughly put a number of points on the map, then edit the markers positions by dragging the polygon handles.

### Edit

To edit a polygon, click the `Edit off` button, it turns red and becomes `Edit on`.
Then click the desired polygon handle on the map, it turns green.
Then drag the handle to the desired position.

To exit editing, click on the `Edit on` button.

### Delete

To delete the polygon, click the `Delete` button.

### Todo

rotation and translation (Turn and Move)