Add name parameter to Analysis Tools
meh9 opened this issue · 3 comments
Let's add a name parameter to the Analysis Tools.
This will deal with the issues #39 and #18.
We have 3 functions, Point, Polygon, and Existing Polygon:
Point
Once the user has picked a point, show/enable an editable Name parameter and populate it by default to the lat/lon with 5 decimals.
Polygon
Once the user has drawn a polygon, show/enable an editable Name parameter and populate it by default with Polygon 1
, and auto-increment this in the browser tab context, restart from 0 when the site is reloaded.
Existing Polygon
Once the user has selected a polygon, show/enable an editable Name parameter and populate it by default to the name of the polygon, or if the polygon has no name property (like when the user drag and drops a GeoJSON) then defer to Polygon above.
Pass the contents of the Name parameter to the WPS service. If the user clears the value and submits with an empty string, just pass the empty string.
If another piece of geometry is selected after the initial piece of geometery the name replaces the name field irrespective of whether the user has overriden the name field or not (i.e. select polygon -> name populated -> select polygon -> name replaced).
"populate it by default to the lat/lon with 5 decimals."
I'd suggest to populate by default with point 1
and auto-increment this in the browser tab context, restart from 0 when the site is reloaded (same as polygon).