| MGSelectionChangedObserver.onSelectionChanged |
|
public abstract void onSelectionChanged(MGMap map)
The changed selection observer event method. This event is fired when the map selection has changed.
This topic describes this event for Plug-In and Java Edition only. For ActiveX Control, see onSelectionChanged.
Plug-In and Java Edition only
map - The map object for which the event occurred.
none
If your application has notify (the second argument of addObject) set to True, writing code in the onSelectionChanged event that changes the selection will result in an infinite loop. For example:
var mapSel = map.getSelection();
var obj = layer.getMapObject('CA');
mapSel.addObject(obj, true);
To handle this event from the Plug-In or Java Edition, a Java object that implements the MGSelectionChangedObserver interface must be established with a call to the setSelectionChangedObserver method. The observer Java object should include the following:
<class_definition> implements MGSelectionChangedObserver
{
// ...
public void onSelectionChanged(MGMap map)
{
// event handling code here...
}
// ...
}
The simplest way to include the observer object in a Web page is to implement it as an applet. See Advanced Examples for a fully functional observer object that supports all of the observer interfaces by forwarding the events back to JavaScript functions that have identical semantics to the ActiveX Control event handlers.
getSelectionChangedObserver, setSelectionChangedObserver