Search
MapView.decorationHover Event
See Also
 






Raised when the user hovers over a decoration element.

Namespace: MindFusion.Mapping
File: MapView.js

 Syntax

JavaScript  Copy Code

EventDispatcher decorationHover

 Event Data

The event handler method receives the following arguments:
sender
A MapView instance, which is the source of the event. This object will be passed to the handler function as the first argument.
args
A DecorationEventArgs instance, which contains event data. This object will be passed to the handler function as the second argument.

 Example

The following example creates a new MapView using a <DIV> element called "mapview" that we've declared in the HTML code of the page. It adds a Marker to a DecorationLayer and handles the decorationHover event of the MapView. The MapView class derives from Control.

JavaScript  Copy Code

var m = MindFusion.Mapping;

// create a new instance of the mapView
var view = new m.MapView(document.getElementById("mapView"));
view.theme = "light";
view.decorationHover.addEventListener(handleDecorationHover);

var markers = new m.DecorationLayer("Images");

// create some markers with images
var mark = new m.Marker(new m.LatLong(-22.951916, -43.210487));
mark.imageSrc = "./images/christ_redeemer.png";
mark.text = "Christ the Redeemer";
markers.decorations.add(mark);

view.layers.add(markers);


function handleDecorationHoverk(sender, args)
{
    var marker = args.decoration;
    if ( marker.text == "Christ the Redeemer" )
          marker.visible = false;
 
}

 See Also