Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/workingdog/mappoly
- Owner: workingDog
- License: mit
- Created: 2023-10-03T03:52:10.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-03T04:48:21.000Z (5 days ago)
- Last Synced: 2024-11-03T05:23:03.917Z (5 days ago)
- Language: Swift
- Homepage:
- Size: 20.5 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
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)