Hello,
I want to call an Openalayers3 control from a buttom in a toolbar.
I've made serveral buttoms with a function and work. But now I'm trying to do the same with an openlayers3 control and I don't know how to do that.
In other versions of Ext JS and Openlayers, it could be done.
Here are some examples about what I'm doing:
var toolBar = new Ext.toolbar.Toolbar({
items: [
{
xtype: 'button', /*Button Zoom Alejar*/
baseCls: 'btn-button',
html: '<i class="fa fa-search-minus" aria-hidden="true"></i>',
tooltip: "Zoom Alejar",
listeners: {
click: function() {
var view = olMap.getView();
var zoom = view.getZoom();
view.setZoom(zoom - 0.5);
}
}
},
{
xtype: 'button', /*Button Full Screen*/
baseCls: 'btn-button',
tooltip: "Pantalla Completa",
listeners: {
click: function() {
olMap.addControl(new ol.control.FullScreen());
}
}
},
]
});
If I do that (olMap.addControl(new ol.control.FullScreen())when I click in the button apears the openlayers button for Fullscreen in the map but it doesn't apear in the toolbar.
How can I do to put the control in the toolbar's button?
Thanks