Source code:
fire.require(
function(){
var output = $("#output > pre > code");
var pm = new fire.gear.geom.PrecisionModel(fire.gear.geom.PrecisionModel.FLOATING);
var factory = new fire.gear.geom.GeometryFactory(pm);
var c1 = new fire.gear.geom.Coordinate(8, 43, 10);
var c2 = new fire.gear.geom.Coordinate(8, 44, 10);
var c3 = new fire.gear.geom.Coordinate(9, 45, 10);
var ls1 = factory.createLineString([c1,c2,c3]);
output.append("LINESTRING: " + ls1.toString() + "<br/>");
output.append("isValid?: " + ls1.isValid() + "<br/>");
output.append("lenght: " + ls1.getLength() + "<br/>");
output.append("centroid: " + ls1.getCentroid() + "<br/>");
var env = ls1.getEnvelope();
output.append("envelope: " + env.toString() + "<br/>");
output.append("<br/>");
output.append("points: " + ls1.getNumPoints() + "<br/>");
for(var i=0; i < ls1.getNumPoints(); i++){
output.append("point " + i + ": " + ls1.getPointN(i).toString() + "<br/>");
}
output.append("<br/>");
output.append("coordinates: " + ls1.getCoordinates() + "<br/>");
for(var i=0; i < ls1.getCoordinates().length; i++){
output.append("coordinate " + i + ": " + ls1.getCoordinateN(i).toString() + "<br/>");
}
output.append("<br/>");
output.append("Start point: " + ls1.getStartPoint() + "<br/>");
output.append("End point: " + ls1.getEndPoint() + "<br/>");
output.append("is closed?: " + ls1.isClosed() + "<br/>");
} , {
modules : [fire.Modules.GEAR]
,mode : fire.Mode.BUILD
,otherScripts: []
,relative: "../lib/fire/"
}
);