getLabelLayer();
The getLabelLayer method returns map labels layer.
The method returns a value of the SVGElement type.
To execute the example the HTML page must contain the MapChart component named map (see Example of Creating the MapChart Component). Create a new label and place it on the map labels layer:
// Create a label var label = new PP.MapLabel({ Chart: map, Text: "Russian Federation map", Width: 150 }); // Set offset from the left edge of the map label.setLeft(map.getWidth() / 2 - 75); // Draw the label label.draw(null, map.getDomNode()); // Get map labels layer var labelLayer = map.getLabelLayer(); // Add the label to this layer labelLayer.appendChild(label.getDomNode());
After executing the example a new label with the text "Russian Federation map" is added on the map labels layer:
See also: