[mapguide-users] Mouse cursor in Ajax viewer

flakesns flakesns at gmail.com
Mon Sep 17 21:16:41 EDT 2007


Hi, i'm using MG 1.2RC in windows XP.

My solution based on Jackie Ng great code.

Open toolbar.templ in viewerfiles folder.

Add this code:

function changeIcon(action){
	var cururl = "http://localhost/mapguide/stdicons/";
	var map = parent.mapFrame.document.getElementById("map");
	switch(action)
	{
		case 1:
			map.style.cursor = cururl + "icon_pan.cur"
			break;
		case 7:
			map.style.cursor = cururl + "icon_zoomin.cur"
			break;
		case 8:
			map.style.cursor = cururl + "icon_zoomout.cur"
			break;
		case 9:
			map.style.cursor = cururl + "icon_zoomrect.cur"
			break;
		default:
			map.style.cursor = 'default';
			break;
	} 
	
}

Then find OnCommandExecuted,

function OnCommandExecuted(action)
{
	changeIcon(action)
        .....
        .....
        .....
}



Kayne M. Morvant wrote:
> 
> Hi,
> 
> Is it possible to change the mouse cursor in the Ajax viewer to mimic the 
> behavior of the DWF viewer? If I select 'Zoom Rectangle' or 'Pan', etc.
> the 
> cursor never changes from the arrow style.
> 
> If this is not currently implemented, would it be possible to add this as 
> an enhancement to a future release?
> 
> -Kayne
> 
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> 
> 

-- 
View this message in context: http://www.nabble.com/Mouse-cursor-in-Ajax-viewer-tf3891016s16610.html#a12748237
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list