[mapguide-users] OnSelection Event?
Willem Schwarte
willem at giskit.nl
Fri May 5 04:03:32 EDT 2006
Cool. Changing the default handler to my own function. I'm gonna check
this out next.
Maybe you have got an answer on my question about the xml that is
returned?
Willem
________________________________
Van: Jason Birch [mailto:Jason.Birch at nanaimo.ca]
Verzonden: vrijdag 5 mei 2006 9:32
Aan: users at mapguide.osgeo.org
Onderwerp: 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 --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide_users/attachments/20060505/ea7a7f4e/attachment.html
More information about the Mapguide_users
mailing list