Map draw tool: undo, distance corridor, live count and measuring (follow-up to #1089)

Aperta
#1,105 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript, python
Ambito
desktop, frontend

Direzione di ricerca

Start with the existing draw tool that #1089 added. The issue names the Python shape_changed signal, the LineShape class used for counting caches, and the Leaflet L.circle and Geoman layers on the map. Undo is the most self-contained part and could ship first as its own PR; the corridor and live-count parts need agreement on the design. Done means each part works separately, with the parts split into separate PRs as the issue suggests.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

improvement
Current State
Problem Statement

#1089 adds a draw tool for the Line/Polygon filter. You can draw a polygon, a line or points, edit them, use them as a filter, and the map shows the active filter's shape. A few things are still missing for everyday use:

  • No undo. One wrong drag of a vertex can only be fixed by hand or by starting over. The GSAK Polygon Editor has undo (see @lignumaqua's feedback in #1089).
  • The distance is invisible. The map shows the filter's line, polygon or points, but not the corridor around them that the filter's distance adds. So you can't see which caches will match before you apply the filter.
  • No feedback while drawing. You only learn how many caches a shape catches after you apply it, and there is no way to see a line's length or a polygon's area.
Proposed Improvement
Proposed Solution

Happy to receive feedback if some parts are not needed or missing

In this order, maybe as separate PRs:

  1. Undo: Ctrl+Z and an Undo button in the "Draw on map…" dialog and in draw mode on the main map. A short history of the shape, built from the existing shape_changed signal in Python. Free Geoman has no undo.
  2. Distance corridor: draw the filter's distance around the outline of the active filter's shape:
    • Points: an exact L.circle around each point.
    • Line: a buffered polygon that is correct at any zoom level (a wide polyline would change with zoom).
    • Polygon: an outer buffer when the distance is greater than 0.
  3. Live count and measuring (they share one label on the map):
    • "N caches inside / near" while drawing. Computed in Python with LineShape over the caches already on the map, so no database query, and debounced.
    • Line length (great-circle) and polygon area, in km or miles according to the settings.
Later / ideas

These can become their own issues if somebody requests it:

  • Save drawn shapes as named files and pick them from the Line/Polygon tab. Use the same format as roadmap #777 "your own polygons".
  • Export a shape as GPX/KML/GeoJSON. GPX tracks and KML can already be read.
  • Paste detection: text pasted into the point list that starts with # mode: polygon switches the filter type.
  • Snap a vertex to a cache or waypoint and write it as W,GCxxxx.
  • More than one shape at a time, like the GSAK Polygon Editor.
  • A lat/long grid overlay (suggested by @lignumaqua in #1089).
Expected Benefits

No response

Lingua principale
Python
Stelle
37
Fork
17
Merge medio
16h 7m
PR unite (30g)
128

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OpenSAK-Org/OpenSAK

Tutte le issue di OpenSAK-Org/OpenSAK

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.