[OpenLayers-Users] single line modify

Alexandre Dube adube at mapgears.com
Fri Jan 15 08:38:22 EST 2010


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