none
[Bing Maps V8] Changing cursor on pushin MouseOver RRS feed

  • Question

  • I am changing the cursor on a markers mouseover event. This worked fine in V7, however in V8, I am noticing that changing the cursor of the marker in the event , it is still showing the previous cursor.  marker.setOptions doesnt take effect until the user leaves the marker and comes back to it.
    Tuesday, September 13, 2016 1:42 PM

Answers

  • In V8, you set the cursor when creating the pushpin. It will automatically change to that cursor when you however over the pushpin. You don't need to set the cursor when mousing over the pushpin. Note that the cursor will only automatically change if there is an event on the pushpin, otherwise the user can't interact with the pushpin and changing the cursor would be confusing to the user. Here is a simple code sample you can try in the interactive SDK:

    var map = new Microsoft.Maps.Map(document.getElementById('myMap'), {
        credentials: 'Your Bing Maps Key'
    });
    var pushpin = new Microsoft.Maps.Pushpin(map.getCenter(), { cursor: 'move' });
    Microsoft.Maps.Events.addHandler(pushpin, 'click', function(e){ /* do something */})
    map.entities.push(pushpin);
    


    [Blog] [twitter] [LinkedIn]

    Tuesday, September 13, 2016 4:59 PM