draggableCursor doesn't change to wait cursor

167 views
Skip to first unread message

Geoff Schultz

unread,
Sep 4, 2012, 11:53:03 AM9/4/12
to google-map...@googlegroups.com
I am trying to change the draggable cursor to the wait cursor, but it never changes.  The following code is invoked after a user clicks on a marker or bounding box.  When I click on an object the cursor goes from an open hand to a closed hand.  Once the URL request has been completed, the hand goes back to the open hand.  In some cases it can take several seconds for the URL request to complete.  There's no difference between leaving the "map.setOptions({draggableCursor:'wait'});" code in or commenting it out.

What am I doing wrong?

-- Geoff

function httpRequest(url)
    {
    var pageRequest = false; //variable to hold ajax object
    map.setOptions({draggableCursor:'wait'});
    /*@cc_on
       @if (@_jscript_version >= 5)
          try {
          pageRequest = new ActiveXObject("Msxml2.XMLHTTP")
          }
          catch (e){
             try {
             pageRequest = new ActiveXObject("Microsoft.XMLHTTP")
             }
             catch (e2){
             pageRequest = false
             }
          }
       @end
    @*/
   
    if (!pageRequest && typeof XMLHttpRequest != 'undefined')
       {pageRequest = new XMLHttpRequest();}
   
    if (pageRequest)
        {       
           pageRequest.open('GET', url, false); //get page synchronously
           pageRequest.send(null);
           openInfoWindow(pageRequest, 0);
        }
    map.setOptions({draggableCursor:null});

    }

Geoff Schultz

unread,
Sep 4, 2012, 8:42:27 PM9/4/12
to google-map...@googlegroups.com
The issue is that I was doing a synchronous get, which basically caused the entire browser to hang waiting for the response.  I changed it to an asynchronous ajax get and the cursor now changes to the wait cursor as I'd expect. 

However, in the 1st line of the ajax "success" function, I change the cursor back to the normal cursor abd then open an infoWindow with the response.  If the cursor is outside of the infoWindow, it continues to display the wait cursor until I move it, at which point it reverts to the normal cursor.  If the cursor was within the location of the infoWindow, it remains a wait cursor until I move it outside of the infoWindow.  Any ideas on this?

-- Geoff

Geoff Schultz

unread,
Sep 5, 2012, 7:58:45 AM9/5/12
to google-map...@googlegroups.com
Note that I've moved my questions regarding when the cursor changes to a new thread.
Reply all
Reply to author
Forward
0 new messages