Commit aab1018f authored by Luis Dominguez's avatar Luis Dominguez

Merge branch 'dev' of gitlab.geoint.mx:mario.chirinos/GeoInt_SIDT into dev

parents 105f391c 76f25be1
......@@ -52,6 +52,19 @@ html, body
}
.drawControl{
width: 50px;
height: 50px;
position: absolute;
right: 20px; /*270px*/
bottom: 75px;
z-index: 1000;
background-color: white;
border-radius: 5px;
border: none;
}
.iii{
color: rgba(220, 121, 40, 0.404);
width: 50px;
......
......@@ -134,6 +134,53 @@ sidtMap.prototype.addInteraction = function()
});
this.map.addInteraction(this.interaction);
$("#drawControl").val("Polygon");
}
sidtMap.prototype.changeInteraction = function() {
this.map.removeInteraction(this.interaction);
var self = this;
var drawValue = $("#drawControl").val();
if (drawValue !== 'Square') {
this.interaction = new ol.interaction.Draw({
source:this.vectorLayer.getSource(),
geometryFunction: new ol.interaction.Draw.createRegularPolygon(4, Math.PI/4),
features: this.features,
type: "Circle"
});
$("#drawControl").val("Square");
$("#drawControl").children().first().removeClass('fa-vector-square');
$("#drawControl").children().first().addClass('fa-draw-polygon');
} else {
this.interaction = new ol.interaction.Draw({
source:this.vectorLayer.getSource(),
features: this.features,
type: "Polygon"
});
$("#drawControl").val("Polygon");
$("#drawControl").children().first().removeClass('fa-draw-polygon');
$("#drawControl").children().first().addClass('fa-vector-square');
}
this.interaction.on("drawend",function(e){
self.showCoords(e.feature.getGeometry());
let processTreeview = $('li.processTreeview a');
let parentClassList = processTreeview[0].parentElement.classList;
if(!parentClassList.contains('menu-open')){
processTreeview.click();
}
});
this.interaction.on("drawstart",function(e){
self.removePolygon();
});
this.map.addInteraction(this.interaction);
}
//------------------------------------------------------------------------------
sidtMap.prototype.onMousemove = function(e)
......
......@@ -246,6 +246,12 @@
</div>
<!-- control de version de mapas -->
<!-- control para dibujar el poligono -->
<div id="drawControl" class="drawControl" onclick="osmap.changeInteraction()">
<i class="fas fa-vector-square fa-2x iii"></i>
</div>
<!-- control para dibujar el poligono -->
<footer class=" page-footer font-small special-color-dark pt-5" style="bottom: 0; position: absolute">
<!-- Footer Elements -->
<div class="container">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment