MapShape.MouseMove

Syntax

MouseMove: function(sender, args);

Parameters

sender. Event source.

args. Event information.

Description

The MouseMove event is fired when mouse pointer moves over map layer area.

Example

To execute the example the HTML page must contain the MapChart component named map (see Example of Creating the MapChart Component). Process the MouseMove event by showing name of the data layer area with the ID RU-KYA in the browser console, when the mouse cursor moves over it:

// Get map layer area with the ID RU-KYA
var shape = map.getShape("RU-KYA");
// Process the MouseOver event
shape.MouseMove.add(function (sender, args) {
    console.log("Selected map layer area: " + args.ShapeName);
});
// Process the MouseOver event
map.MouseOver.add(function (sender, args) {
    if (sender.getType() == PP.MapChartType.SVG) {
        if (args != null) {
            // Get map layer area
            var shape = sender.getShape(args.ShapeId);
            // Fire the MouseMove event for this layer
            shape.MouseMove.fire(shape, args);
        }
    }
});

After executing the example on moving the mouse pointer over the data layer area with the RU-KYA identifier, area name is shown in the browser console:

Selected map layer area: Krasnoyarsk region

See also:

MapShape