added box shape, removed multiple geometries, tuned icons

This commit is contained in:
dcore94 2024-06-04 16:07:11 +02:00
parent 9ffdfa9a0b
commit 0eb335cc17
2 changed files with 11 additions and 5 deletions

View File

@ -116,8 +116,8 @@ class CCPExecutionForm extends HTMLElement{
<option value="text/julia" data-ext="jl" title="Generate Julia 1.9.0 code (HTTP 1.10.0, JSON3 1.13.2)">Julia 1.9.0</option>
<option value="application/x-sh+curl" data-ext="sh" title="Generate Bash script (curl)">Bash (curl)</option>
<option value="application/x-sh+wget" data-ext="sh" title="Generate Bash script (wget)">Bash (wget)</option>
<option value="application/json+galaxy" data-ext="json" title="Generate JSON request for Galaxy">Galaxy CCP request</option>
<option value="application/xml+galaxy" data-ext="xml" title="Generate installable Galaxy tool">Galaxy tool</option>
<option value="application/json+galaxy" data-ext="json" title="Generate JSON request for Galaxy">Galaxy CCP request (preview)</option>
<option value="application/xml+galaxy" data-ext="xml" title="Generate installable Galaxy tool">Galaxy tool (preview)</option>
</select>
<button name="codegen" title="Generate code" class="btn btn-primary ccp-toolbar-button ccp-toolbar-button-small">
<svg viewBox="0 96 960 960">

View File

@ -812,9 +812,10 @@ class CCPGeoInputWidgetController extends CCPBaseInputWidgetController {
<div name="maptoolbar" class="mb-1" style="border-bottom: solid 1px gray;">
<div class="d-flex justify-content-between m-0">
<div>
<span title="Draw a rectangular box" name="Box" class="btn text-primary p-0 material-icons">crop_16_9</span>
<span title="Draw a circle" name="Circle" class="btn text-primary p-0 material-icons">radio_button_unchecked</span>
<span title="Select a Point" name="Point" class="btn text-primary p-0 material-icons">my_location</span>
<span title="Draw a Polygon" name="Polygon" class="btn text-primary p-0 material-icons">polyline</span>
<span title="Draw a Polygon" name="Polygon" class="btn text-primary p-0 material-icons" style="color:transparent">pentagon</span>
<span title="Delete all" name="deletebtn" class="btn text-danger p-0 material-icons">delete</span>
</div>
<div>
@ -876,12 +877,17 @@ class CCPGeoInputWidgetController extends CCPBaseInputWidgetController {
this.#target = this.rootdoc.querySelectorAll("textarea").item(this.#index)
ev.preventDefault()
ev.stopPropagation()
}else if(["Circle", "Point", "Polygon"].indexOf(type) !== -1){
}else if(["Circle", "Point", "Polygon", "Box"].indexOf(type) !== -1){
ev.stopPropagation();
ev.preventDefault();
this.undoAllDrawings()
if(this.#draw != null && this.#draw.type === type) return;
if(this.#draw != null) this.#map.removeInteraction(this.#draw);
this.#draw = new ol.interaction.Draw({source: this.#source, type : type})
this.#draw = new ol.interaction.Draw({
source: this.#source,
type : type === "Box" ? "Circle" : type,
geometryFunction : type === "Box" ? ol.interaction.Draw.createBox() : null
})
this.#map.addInteraction(this.#draw)
}else if(type === "deletebtn"){
this.undoAllDrawings()