drawing button

parent 44a74f0e
...@@ -25,3 +25,8 @@ html, body ...@@ -25,3 +25,8 @@ html, body
background-color: rgba(220,220,220,0.9); background-color: rgba(220,220,220,0.9);
float:right; float:right;
} }
#div-draw-btn
{
text-align: center;
}
\ No newline at end of file
...@@ -105,20 +105,22 @@ function sidtMap(divID, lng, lat, z) ...@@ -105,20 +105,22 @@ function sidtMap(divID, lng, lat, z)
this.map.on("pointermove",function(e){self.onMousemove(e)}); this.map.on("pointermove",function(e){self.onMousemove(e)});
}; };
sidtMap.prototype = Object.create( OpenStreetMapsClass.prototype ); sidtMap.prototype = Object.create( OpenStreetMapsClass.prototype );
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
sidtMap.prototype.addInteraction = function()
sidtMap.prototype.draw = function ()
{ {
var self = this; var self = this;
this.interaction = new ol.interaction.Draw({ this.interaction = new ol.interaction.Draw({
source:this.vectorLayer.getSource(), source:this.vectorLayer.getSource(),
features: this.features, features: this.features,
type: "Polygon" type: "Polygon"
}); });
this.interaction.on("drawend",function(e){ this.interaction.on("drawend",function(e){
self.showCoords(e.feature.getGeometry()); self.showCoords(e.feature.getGeometry());
self.map.removeInteraction(self.interaction);
}); });
this.interaction.on("drawstart",function(e){ this.interaction.on("drawstart",function(e){
...@@ -127,6 +129,18 @@ sidtMap.prototype.addInteraction = function() ...@@ -127,6 +129,18 @@ sidtMap.prototype.addInteraction = function()
this.map.addInteraction(this.interaction); this.map.addInteraction(this.interaction);
} }
sidtMap.prototype.addInteraction = function()
{
var self = this;
this.interactionSelect = new ol.interaction.Select({
condition: ol.events.condition.pointerMove
});
this.map.addInteraction(this.interactionSelect);
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
sidtMap.prototype.onMousemove = function(e) sidtMap.prototype.onMousemove = function(e)
{ {
......
...@@ -199,8 +199,7 @@ ...@@ -199,8 +199,7 @@
<li> <li>
<a href="#"> <a href="#">
<span> <span>
<i class="fa fa-search"></i> <button type="submit" name="search" id="search-btn" class="btn btn-primary"><i class="fa fa-search"></i> Search</button>
<button type="submit" name="search" id="search-btn" class="btn btn-primary">Search</button>
<!-- <button name="search" id="search-btn" class="btn btn-primary">Search</button> --> <!-- <button name="search" id="search-btn" class="btn btn-primary">Search</button> -->
</span> </span>
</a> </a>
...@@ -212,6 +211,10 @@ ...@@ -212,6 +211,10 @@
</ul> </ul>
</form> </form>
</div> </div>
<div id="div-draw-btn">
<button type="submit" name="draw" id="draw-btn" class="btn btn-primary" onclick="osmap.draw()"><i class="fa fa-object-ungroup"></i> Dibujar</button>
</div>
<!-- form-group--> <!-- form-group-->
{% endblock %} {% endblock %}
......
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