[OpenLayers-Users] Modify object other then from muse click
Alexandre Dube
adube at mapgears.com
Mon Feb 8 08:33:54 EST 2010
Hi,
The ModifyFeature control has its own SelectFeature control, so you
could do the following when your checkbox is checked :
var features = youVectorLayer.selectedFeatures;
for(i=0; i<features.length; i++) {
yourSelectFeatureControl.unselect(features[i]);
yourModifyFeatureControl.selectControl.select(features[i]);
}
Please note that even though I make a loop above, the ModifyFeature
control doesn't support multiple selection, so yourSelectFeatureControl
should have its multiple property set to false;
Hope this helps,
Alexandre
paweluz wrote:
> Hi!
>
> I hope some of more experiences OpenLayers users could help me with my next
> problem. I have a line goemetry on map that I can select and modify. When I
> click on road on map the info about road is presented on the right of the
> page in 'Information' fieldset.
>
> http://img3.imageshack.us/img3/5350/77062173.jpg
>
> The object parameters can not be changed, unless the checkbox is checked.
>
> http://img693.imageshack.us/img693/7809/44422866.jpg
>
> If it is, the control is changed from select to modify. But I have to click
> twice on that geometry to modify it. First I click on it and I unselect
> geometry
>
> http://img685.imageshack.us/img685/761/74394384.jpg
>
> Second I click and I can modify the geometry.
>
> http://img191.imageshack.us/img191/7878/45033082.jpg
>
> The goal is to achieve functionality that after changing checkbox to true
> the selected line on a map would change to modify mode. Without the double
> clicking on it. Just changing the style (I mean mode but this is maybe more
> clearly) of geometry on the map from select to modify by changing the
> checkbox mode. Is it possible ?? I may show you my code if you would like.
> Please... any ideas would be good...
>
> BTW... Sorry for my poor English
>
> Thanks,
> Poul
>
>
--
Alexandre Dubé
Mapgears
www.mapgears.com
More information about the Users
mailing list