Results 1 to 3 of 3

Thread: Call Openlayers3 control from a buttom

  1. #1
    Sencha User
    Join Date
    Apr 2017
    Posts
    2

    Default Call Openlayers3 control from a buttom

    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

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    This seems more like an openlayers question. With which version of Ext JS did this work for you?

  3. #3
    Sencha User
    Join Date
    Apr 2017
    Posts
    2

    Default

    There is an example here: https://github.com/vahid-sohrabloo/G...les/toolbar.js
    I want to do something similar. But "new Ext.Action" instead of "new GeoExt.Action" but Ext.Action hasn't the control method.

Similar Threads

  1. Replies: 6
    Last Post: 28 May 2014, 12:08 AM
  2. Kitchen Sink Skeleton : lateral buttons control (how to call the right panel) ?
    By mikovb in forum Sencha Architect 2.x: Help & Discussions
    Replies: 1
    Last Post: 3 Sep 2013, 3:54 AM
  3. On/Off toggle buttom
    By tomalex0 in forum Sencha Touch 1.x: Examples and Showcases
    Replies: 26
    Last Post: 24 Aug 2012, 4:04 AM
  4. Replies: 2
    Last Post: 17 Jun 2012, 9:29 PM
  5. add tab from a link or a buttom
    By simpaulguy in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 29 Dec 2006, 11:37 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •