[OpenLayers-Users] boundaries of lineString

Pierre GIRAUD bluecarto at gmail.com
Mon Feb 11 05:29:33 EST 2008


It should be quite easy because geometry like lineString and Polygon
are composite geometries.
For example, a OpenLayers.LineString has a 'components' property which
is an array of OpenLayers.Points.
That way, you can get all the vertices using a loop like following :

for(var i=0; i <= thelinestring.components.length; i++) {
    // do something with thelinestring.components[i] which is an OL point
}

Regards,
Pierre

On Feb 11, 2008 9:02 AM, Rupesh M G <RupeshM at ibsplc.com> wrote:
>
> Hi,
>
>         I'm working on an application about roads. There I need to mark a
> part of the road, and execute some query.
>
> My user will click a set of points to form a sequence of lines passing
> through the center of the road, because there can be bends in the road.
>
> I plan to draw a lineString going through these points. Using a bigger
> strokeWidth, I can show it like a road (or like a filled polygon).
>
> Is there any way to get the vertices of that polygon?
>
>
> Thanks & Regards,
> Rupesh
>
>
>
>  DISCLAIMER:
>
>  "The information in this e-mail and any attachment is intended only for the
> person to whom it is addressed and may contain confidential and/or
> privileged material. If you have received this e-mail in error, kindly
> contact the sender and destroy all copies of the original communication. IBS
> makes no warranty, express or implied, nor guarantees the accuracy, adequacy
> or completeness of the information contained in this email or any attachment
> and is not liable for any errors, defects, omissions, viruses or for
> resultant loss or damage, if any, direct or indirect."
>
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>



More information about the Users mailing list