<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Event that captures mouse action</TITLE>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18828"></HEAD>
<BODY bgColor=#ffffff text=#000000>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=566444714-05112009>Hi Kenneth,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=566444714-05112009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=566444714-05112009>Thanks so much for your example. It worked really
well. I have listed my working copy as further reference.
</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=566444714-05112009>Now, I have one more question: I want to associate the
functionality with a new command on the toolbar which is easy enough. The
trouble is that the new command can be activated by clicking it but it does not
STAY selected like the built-in commands once they have been activated.
So, how can I make a custom command stay selected after it has been
activated?</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=566444714-05112009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=566444714-05112009>Thanks,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=566444714-05112009>Gido </SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=566444714-05112009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=566444714-05112009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=566444714-05112009>// Copy original function to new
pointer<BR>origOnMapLoadingFunc =
parent.parent.mapFrame.OnMapLoading;</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=566444714-05112009>// Redefine old OnMapLoading
function<BR>parent.parent.mapFrame.OnMapLoading = function() {<BR> // Does
somethimg<BR>}</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=566444714-05112009>// Call "new"
functionality<BR>paren.parent.mapFrame.OnMapLoading();</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=566444714-05112009>//Run old function
<BR>origOnMapLoadingFunc();<BR></SPAN></FONT></DIV><BR>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> mapguide-users-bounces@lists.osgeo.org
[mailto:mapguide-users-bounces@lists.osgeo.org] <B>On Behalf Of </B>Kenneth
Skovhede, GEOGRAF A/S<BR><B>Sent:</B> November 4, 2009 00:45<BR><B>To:</B>
MapGuide Users Mail List<BR><B>Subject:</B> Re: [mapguide-users] Event that
captures mouse action<BR></FONT><BR></DIV>
<DIV></DIV>There is a function called "OnMapLoading" which you can hijack like
this:<BR><BR>//Keep a reference to the original
function<BR>GetMapFrame().original_OnMapLoading =
GetMapFrame().OnMapLoading;<BR><BR>//Assign a new
function<BR>GetMapFrame().OnMapLoading = function(){<BR><BR>
try {<BR> <BR>
//Place more meaningfull code here :)<BR>
alert("The map is now loading");<BR><BR> }
catch (e) //Make sure our code does not break the
function<BR> {} <BR><BR> //Activate the
actual MapGuide handler<BR>
original_OnMapLoading();<BR>};<BR><BR><PRE class=moz-signature cols="72">Regards, Kenneth Skovhede, GEOGRAF A/S
</PRE><BR><BR>Langen, Gido skrev:
<BLOCKQUOTE
cite=mid:EDE78E704FF591488634CF2607D4F95E02E2EEC0@s0-ott-x4.nrn.nrcan.gc.ca
type="cite">
<META name=Generator content="MS Exchange Server version 6.5.7654.12"><!-- Converted from text/rtf format -->
<P><FONT size=2 face=Arial>Does anyone know how to capture a mouse click on
the map? I want to do some scale dependent processing and want to
capture the scale after zooming in/out. I need to know the scale right
after the zoom in/out, before the map is redrawn. </FONT></P>
<P><FONT size=2 face=Arial>Thanks for any insight,</FONT> <BR><FONT size=2
face=Arial>Gido </FONT></P><PRE wrap=""><HR SIZE=4 width="90%">
_______________________________________________
mapguide-users mailing list
<A class=moz-txt-link-abbreviated href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</A>
<A class=moz-txt-link-freetext href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</A>
</PRE></BLOCKQUOTE></BODY></HTML>