[OpenLayers-Dev] no 'addcontrol' event?

Alexandre Dubé adube at mapgears.com
Thu May 23 07:32:23 PDT 2013

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*/);



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
> Dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-dev

Alexandre Dubé

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20130523/6828fc3f/attachment.html>

More information about the Dev mailing list