[OpenLayers-Users] about eventListeners

Lehtonen, Mika mika at digikartta.net
Thu Nov 6 16:47:44 EST 2008


Hi again,

I just haven't even yet been able to understand all the event handling, 
listening, registering and so on. I have this pair of draw and modify 
controls in my code in order to draw a "circle" and afterwards modify 
it. It works fine. What I haven't been figuring out is that how can I 
build a function here what would both show the radius of the circle 
while drawing/modifying it and would restrict it, in other words would 
put some extent or limit to it. Any hints?

thanks,
- mika -

            var circle = new OpenLayers.Control.DrawFeature(vlayer,
                                            
OpenLayers.Handler.RegularPolygon,
                                            {handlerOptions: {sides: 40} });
           
            map.addControl(circle);

          mod = new OpenLayers.Control.ModifyFeature(vlayer);
       mod.mode |= OpenLayers.Control.ModifyFeature.DRAG
       mod.mode |= OpenLayers.Control.ModifyFeature.RESIZE
       mod.mode &= ~OpenLayers.Control.ModifyFeature.RESHAPE
          map.addControl(mod);



More information about the Users mailing list