Search
Poly Class
Remarks See Also
 






Represents a polyline drawing.

Namespace: MindFusion.Mapping
File: Poly.js

 Syntax

JavaScript  Copy Code

// class
Poly.prototype = {}

 Remarks

The Poly class extends the Drawing class and represents a geometrical figure that is built from a list of points. The points are connected with straight lines.

 Example

The following code creates a new Polyline from an array with points and adds it to the decorations of a CanvasLayer:

JavaScript  Copy Code

var m = MindFusion.Mapping;

var points = [
    new m.LatLong(3.5308084104036523, -75.68240577939847),
    new m.LatLong(3.203158862432781, -75.64670021299222),
    new m.LatLong(2.89597766664142, -75.43246681455472),
    new m.LatLong(2.6669084038224167, -75.51898414853909),
    new m.LatLong(2.6600493665912777, -75.99002296689847)];

var drawings = new m.CanvasLayer("Drawings");
view.layers.add(drawings);


// create a smooth polyline connecting the points
var poly = new m.Poly(points);
poly.stroke = "#0066ff";
// stroke thickness in meters
poly.strokeThickness = 1000;
poly.strokeDashStyle = d.DashStyle.Dash;
poly.smooth = true;
drawings.decorations.add(poly);

 Inheritance Hierarchy

MindFusion.Mapping.Poly

 See Also