[OpenLayers-Users] ModifyControl Select/Delete Vertex?

Robert Smart r_n_smart at hotmail.com
Thu Feb 28 12:35:34 PST 2013


Ok i'll give it a go!

But i might have to ask a few more questions along the way!

Thanks again for all your help.

Rob Smart



On 28 Feb 2013, at 19:05, "Alexandre Dubé" <adube at mapgears.com> wrote:

> Hi Robert,
> 
>   Yep, all the things you ask are quite possible but not without getting your hand a bit dirty :)  You can do all that by programming.  Extend the ModifyControl more to make it do what you want.  Don't be afraid to look at the source code to see what the components do.  You'll get more knowledge that way.
> 
>   I'd be happy to see the end result.  Best of luck to you.
> 
> Kind regards,
> 
> Alexandre
> 
>   
> 
> On 13-02-28 12:36 PM, Robert Smart wrote:
> 
>> This there a way to define a style for the selected vertex?
> 
> Sure.  Look at the OpenLayers.Layer.Feature drawFeature method, second argument.
> 
> 
>>  
>> Is there a way to store a reference to the selected vertex in the modify feature control? So that I could allow a user to select a vertex and then if they choose to delete it, I can just pull out a reference to it in the code from the modify feature. I suppose this could also just be a deleteSeletectedVertex function on the modifyFeature control too.
> 
> Yep, but you'll need to program that.
> 
> 
>>  
>> Is there a way to deselect the the vertex too? So if I click on it and it changes its style to the ‘selected’ style, I can then click on it again to deselect it?
> 
> If you keep track of the current one selected, yeah you could.  This is also done programmatically.
> 
> 
> 
> -- 
> Alexandre Dubé
> Mapgears
> www.mapgears.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130228/378804df/attachment.html>


More information about the Users mailing list