getBoundsRec();
The getBoundsRec method returns a rectangular shape bounding map layer area.
The method returns a JSON object.
To execute the example the HTML page must contain the MapChart component named map (see Example of Creating the MapChart Component). Draw a rectangle bounding map layer area with the RU-KYA identifier:
// Get map layer area with the ID RU-KYA var shape = map.getShape("RU-KYA"); // Get rectangular shape bounding map layer area var bounds = shape.getBoundsRect(); // Draw a rectangle bounding this region var rect = PP.SVG.rect(shape.getParentLayer().getDomNode()); PP.SVG.setAttr(rect, { 'x': bounds.getLeft(), 'y': bounds.getTop(), 'width': bounds.getWidth(), 'height': bounds.getHeight(), 'opacity': 0.5 });
After executing the example a rectangle is drawn bounding map layer area with the RU-KYA identifier:
See also: