[mapguide-users] Patch to change the active tool Cursor in ajax viewer

Kenneth Skovhede, GEOGRAF A/S ks at geograf.dk
Tue Dec 2 06:04:39 EST 2008


I agree that this would be nice to have as a default.
There exists an implementation here:
http://trac.osgeo.org/mapguide/wiki/CodeSamples/JavaScript/CustomCursors
Could you update that one to better match your implementation?

The easiest way to get this into the next release, is to make it in 
"unified diff" format.
On windows, you can use the TortoiseSVN tool for this.
Just check out the trunk of MapGuide (or possibly only the web stuff) 
with TortoiseSVN.
Then modify the files required, and add the cursor files with TortoiseSVN.
Once you are happy with the changes, right click the topmost folder,
and select "TortoiseSVN" -> "Create Patch".

Then create a trac ticket, and attach the patch file.
You must also sign a contributor agreement form.
It sounds like a lot of work, but once done, it is easy
to contribute more later.

Feel free to ask for further info on any of the steps above.

Regards, Kenneth Skovhede, GEOGRAF A/S



Bruno Scott skrev:
> Here is a small patch to make the map cursor reflect the active toolbar
> action.
> function UpdateMapActionCursor(action)
> {
>   var strCursor = "auto";
>   switch(action)
>   {
>     case 1: /*pan*/            strCursor = "url('../stdicons/icon_pan.cur'),
> pointer";    break;
>     case 9: /*Zoom window*/    strCursor =
> "url('../stdicons/icon_zoomrect.cur'), pointer";    break;
>     case 7: /*Zoom plus*/      strCursor =
> "url('../stdicons/icon_zoomin.cur'), pointer";    break;
>     case 8: /*Zoom minus*/     strCursor =
> "url('../stdicons/icon_zoomout.cur'), pointer";    break;
>   }
>   document.getElementById("tbMap").style.cursor = strCursor;
> }
>
> function ExecuteMapAction(action)
> {
>     if(!mapInit)
>         return;
>     CancelDigitization();
>     UpdateMapActionCursor(action);
>     switch(action)
>     {
>     ...
>  it has been tested on IE7,FF3.04 and Chrome
>
>
> It would be great if this piece of code was in the Mapguide core.
> It's possible for a custom applications to override the ExecuteMapAction,
> but i think this is usefull for all Mapguide users. And as the
> ExecuteMapAction function is not an official API, it could change in future
> release, and this make it difficult to maintain.
>
> If you want to test it in Mapguide 2.02 , i've included in attachement the
> complete ajaxmappane.templ and the cursor file itself. Don't forget to make
> a backup of the existing templ file...
> Just replace the existing www/viewerfiles/ajaxmappane.templ and copy the
> cursor file in the www/stdicons directory.
>
> http://www.nabble.com/file/p20789750/MapguideCursor.zip MapguideCursor.zip 
>   


More information about the mapguide-users mailing list