I am having a LineString, where I need to find the vertices logically and save those vertices. Can anyone help me out. Or else how below can help me.
OpenLayers.Geometry.LineString = OpenLayers.Class(OpenLayers.Geometry.Curve, { getVertices: function(nodes) {
var vertices;
if(nodes === true) {
vertices = [
this.components[0],
this.components[this.components.length-1]
];
} else if (nodes === false) {
vertices = this.components.slice(1, this.components.length-1);
} else {
vertices = this.components.slice();
}
return vertices;
}
} );
Please help me.
Thank you