Search
CanvasLayer.id Property
See Also
 






Gets the id of this CanvasLayer.

Namespace: MindFusion.Mapping
File: CanvasLayer.js

 Syntax

JavaScript  Copy Code

get id() {}

 Property Value

String. The id of this layer.

 Example

The following code checks the id of the first Layer in a MapView and if it is "Drawings", adds a Poly to its decorations:

JavaScript  Copy Code

f(mapView.layers.items()[0].id == "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; 
    mapView.layers.items()[0].decorations.add(poly);
}

 See Also