[OpenLayers-Users] re stricting path creation

Christopher Schmidt crschmidt at metacarta.com
Fri Nov 2 16:52:34 EDT 2007


On Fri, Nov 02, 2007 at 01:00:52PM -0700, ibarkley wrote:
> 
> Hello All (newbie question),
> I've been swimming in OpenLayers for about a month now, and I have a very
> simple problem, but for some reason, I can't get it to work: Whenever I use
> a callback for the 'done' property for OpenLayers.Control.DrawFeature and
> OpenLayers.Handler.Path, the path disappears. What I'm trying to accomplish
> is when a user draws a path, after the doubleclick, I need the control to
> change to select, or hover; therefore not allowing the user the ability to
> create more paths on the map. Is this possible? can someone post some sort
> of example that shows this? any help is much, much appreciated... 

You don't want to hook into the callback on the handler. Instead, you
want to hook into (probably) featureAdded on the DrawFeature control --
drawControl.featureAdded = function() { activate_my_control(); }

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list