no 'addcontrol' event?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

no 'addcontrol' event?

Jachym Cepicky
Hi,

looking at the documentation and into Map.js, it seems, there is
'addcontrol' event fired, when new OL.Control arrives to map.


I know, it's little bit late for the next release, but it might be nice
feature to have, relatively fast to implement - any idea?

Jachym

--
Jachym Cepicky
Help Service - Remote Sensing s.r.o.
[hidden email]
HS-RS: [hidden email] http://bnhelp.cz
http://les-ejk.cz


_______________________________________________
Dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-dev

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: no 'addcontrol' event?

Alexandre Dubé
Hi Jachym,

  If you extend the Map object, you could create your own event or do whatever you want in the addControl method directly:

MyMap = OpenLayers.Class(OpenLayers.Map, {
    addControl: function(control, px) {
        OpenLayers.Map.prototype.addControl.apply(this, arguments);

        // do whatever you want here
        // you could trigger a custom event, for example
    }
});

and use :

var map = new MyMap(/* your config*/);

HTH,

Alexandre


On 13-05-23 09:34 AM, Jachym Cepicky wrote:
Hi,

looking at the documentation and into Map.js, it seems, there is
'addcontrol' event fired, when new OL.Control arrives to map.


I know, it's little bit late for the next release, but it might be nice
feature to have, relatively fast to implement - any idea?

Jachym



_______________________________________________
Dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-dev


-- 
Alexandre Dubé
Mapgears
www.mapgears.com

_______________________________________________
Dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-dev