[OpenLayers-Users] single line modify

Wendell Turner wendell at enflight.com
Fri Jan 15 11:19:39 EST 2010


Alexandre,

Thank you.  That works fine.  The only side-effect is that
clicking away from the line doesn't de-activate it.  To
de-activate it you need to click on the navigate icon.

Wendell

On Fri, Jan 15, 2010 at 08:38:22AM -0500, Alexandre Dube wrote:
> Wendell,
> 
> You could register a "activate" event on your ModifyFeature control to 
> select the first feature of the layer as soon as it gets activated. 
> Something like the following (untested) :
> 
> yourModifyFeatureControl.events.on({
> "activate": onModifyControlActivate,
> scope: yourModifyFeatureControl
> });
> 
> yourModifyFeatureControl = function(event) {
> var features = this.layer.features;
> if(features && features.length > 0) {
> this.selectControl.select(features[0]);
> }
> }
> 
> Regards,
> 
> Alexandre
> 
> 
> Wendell Turner wrote:
> >What is the function that, when editing, activates a line
> >segment?
> >
> >On my map I have the modify/navigate functions working fine.
> >When you click on the modify icon, you must then click on
> >the line segment so it turns colors & has move boxes on it.
> >I only have one line segment drawn, and would like to remove
> >the extra click (on the line) so that as soon as you click
> >on the modify icon, the (one) line segment becomes editable.
> >
> >Wendell
> >
> >_______________________________________________
> >Users mailing list
> >Users at openlayers.org
> >http://openlayers.org/mailman/listinfo/users
> >  
> 
> 
> -- 
> Alexandre Dubé
> Mapgears
> www.mapgears.com
> 



More information about the Users mailing list