[OpenLayers-Users] split features

Tim Schaub tschaub at opengeo.org
Wed Aug 4 21:50:26 EDT 2010


Not currently documented as part of the API (should be), but LineString 
and MultiLineString geometries have a split method.

http://dev.openlayers.org/docs/files/OpenLayers/Geometry/LineString-js.html#OpenLayers.Geometry.LineString.split

If you have one feature named "knife" and another named "worm", then you 
could get the relevant parts as follows:

     var parts = knife.geometry.split(worm.geometry);

Tim

On 8/4/10 2:08 AM, Chris Green wrote:
> Hi all
>
> I am wondering if there is a way to use the split control to split line
> features programmatically rather than by a user identifying on a sketch
> layer where a split should be made?
>
> I can determine in javascript where I want to split the feature and I
> don’t want the user involved – does anyone know a way to do that?
>
> Chris
>
>
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users


-- 
Tim Schaub
OpenGeo - http://opengeo.org
Expert service straight from the developers.



More information about the Users mailing list