Search
DecorationEventArgs Constructor
See Also
 






Initializes a new instance of the DecorationEventArgs class.

Namespace: MindFusion.Mapping
File: EventArgs.js

 Syntax

JavaScript  Copy Code

function DecorationEventArgs (decoration, location, position, rawEventArgs)

 Parameters

decoration

Decoration. The the decoration related to the event.

location

LatLong. The geographic cooordinates related to the event.

position

Point. The client position related to the event.

rawEventArgs

Object. The Javascript event data.

 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.

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";
marker.id = 12;
markers.decorations.add(mark);

view.layers.add(markers);


function handleDecorationHoverk(sender, args)
{
    var marker = args.decoration;
    if ( marker.id > 10 )
          marker.visible = false;
 
}

 See Also