MapChart.getToolTipLayer

Syntax

getToolTipLayer();

Description

The getToolTipLayer method returns tooltip layer for map layer areas.

Comments

The method returns a value of the SVGElement type.

Example

To execute the example the HTML page must contain the MapChart component named map (see Example of Creating the MapChart Component). Show a tooltip for map layer area with the RU-SA identifier:

// Get a map layer area by the RU-SA identifier
var shape = map.getShape("RU-SA");
// Get a tool type for this area
var toolTip = shape.getToolTip();
// Get a rectangle bounding the map area
var area = map.getPaperArea();
// Get a layer for tooltips
var toolTipLayer = map.getToolTipLayer();
// Set a position for the tooltip
var rect = shape.getDomNode().getBoundingClientRect();
toolTip.setTargetX(rect.left + rect.width / 2);
toolTip.setTargetY(rect.top + rect.height / 2);
// Show the tooltip
toolTip.show();
// Draw the tooltip
toolTip.draw(area, toolTipLayer);

After executing the example a tooltip is shown for the map layer area with the RU-SA identifier:

See also:

MapChart