[mapguide-users] OnSelection Event?
Jason Birch
Jason.Birch at nanaimo.ca
Fri May 5 03:59:19 EDT 2006
I can't figure out why it's not working for the eMap viewer.
The event relayer frame has a handler defined for the dwf viewer OnSelectionChanged event, and it looks like it is calling the main frame's OnSelectionChanged function. I guess it's possible that it's not getting the overridden function?
On my install, the Microsoft ActiveX behaviour change means that I have to activate the control before interacting with it. I wonder if this is affecting the event handling.
Jason
________________________________
From: Jason Birch [mailto:Jason.Birch at nanaimo.ca]
Sent: Fri 2006-05-05 12:32 AM
To: users at mapguide.osgeo.org
Subject: RE: [mapguide-users] OnSelection Event?
There is an OnSelectionChanged function in the main frame, but it doesn't appear to be documented.
I've just tried playing around with this, and I got the following to work when inserted into the <head> of the ajaxviewersample.php file. It does not appear to work with the DWF viewer; maybe why it's not documented? Or it could just be that my code is bad :)
<script type="text/javascript" >
var originalOnSelectionChanged;
var initTimer = setInterval(watchInitialized, 200);
function watchInitialized () {
try {
if(ViewerFrame.mapFrame.mapInit)
{
clearInterval(initTimer);
originalOnSelectionChanged = ViewerFrame.OnSelectionChanged;
ViewerFrame.OnSelectionChanged = MyOnSelectionChangedHandler;
}
}
catch(Exception) {}
}
function MyOnSelectionChangedHandler() {
originalOnSelectionChanged ();
var mapFrame = ViewerFrame.GetMapFrame();
selCount = mapFrame.GetSelectedCount();
alert("Selected: " + selCount);
}
</script>
________________________________
From: Willem Schwarte [mailto:willem at giskit.nl]
Subject: [mapguide-users] OnSelection Event?
I suppose there is no onSelectionChanged event like in MG6.5. So this would be done on a onClick? Where would I put the code for this?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 6316 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapguide_users/attachments/20060505/4bf858db/attachment.bin
More information about the Mapguide_users
mailing list