+ crop_16_9
radio_button_unchecked
my_location
- polyline
+ pentagon
delete
@@ -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()