[OpenLayers-Users] clickTolerance for OpenLayers.Control.ModifyFeature

Alexandre Dube adube at mapgears.com
Wed Feb 16 13:19:53 EST 2011


Hi,

   The OpenLayers.Handler.Feature has a clickTolerance property [1], not 
the SelectFeature control.  Still, the SelectFeature control use a 
Feature handler and the ModifyFeature control use a SelectFeature control.

   Since the you can't set any handler options when creating either a 
SelectFeature or a ModifyFeature control [2], you should override the 
clickTolerance value before creating them, as such :

   OpenLayers.Handler.Feature.prototype.clickTolerance = 10;

Regards,

Alexandre

[1] 
http://trac.osgeo.org/openlayers/browser/branches/openlayers/2.10/lib/OpenLayers/Handler/Feature.js#L59
[2] 
http://trac.osgeo.org/openlayers/browser/branches/openlayers/2.10/lib/OpenLayers/Control/SelectFeature.js#L197


On 11-02-16 10:01 AM, jkm wrote:
> Hi,
>
> I would like to know if I'm in the right way..
> I want to modify some features in a layer. And I do ..
>
> dragcontrol = new OpenLayers.Control.ModifyFeature(lyr);
> map.addControl(dragcontrol);
> dragcontrol.activate();
>
> I've seen that the SelectFeature has a clickTolerance property, is 
> there any property similar to that in the modify?
> Or i'm doing something  bad ?
>
> Thanks!
>
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users


-- 
Alexandre Dubé
Mapgears
www.mapgears.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110216/578385d8/attachment.html


More information about the Users mailing list