Some javascript/style in this post has been disabled (
why?)
Event that captures mouse action
Hi Kenneth,
Thanks so much for your example. It worked really
well. I have listed my working copy as further reference.
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?
Thanks,
Gido
// Copy original function to new
pointer
origOnMapLoadingFunc =
parent.parent.mapFrame.OnMapLoading;
// Redefine old OnMapLoading
function
parent.parent.mapFrame.OnMapLoading = function() {
// Does
somethimg
}
// Call "new"
functionality
paren.parent.mapFrame.OnMapLoading();
//Run old function
origOnMapLoadingFunc();
There is a function called "OnMapLoading" which you can hijack like
this:
//Keep a reference to the original
function
GetMapFrame().original_OnMapLoading =
GetMapFrame().OnMapLoading;
//Assign a new
function
GetMapFrame().OnMapLoading = function(){
try {
//Place more meaningfull code here :)
alert("The map is now loading");
}
catch (e) //Make sure our code does not break the
function
{}
//Activate the
actual MapGuide handler
original_OnMapLoading();
};
Regards, Kenneth Skovhede, GEOGRAF A/S
Langen, Gido skrev:
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.
Thanks for any insight,
Gido
_______________________________________________
mapguide-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-users
_______________________________________________
mapguide-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-users