none
Resizing a shape by dragging its border RRS feed

  • Question

  • Hi!

     I am currently trying to change the shape of a circle by draggging its border but it seems that Bing maps intercept the mousemove event when the left mouse button is pressed and do not fire my mousemove handler while moving the map itself... Is there a way to disable the map draggging feature and get my mousemove handler fired?

     

    I use Bing Maps Ajax V7 component.

     

    Cheers!

    • Moved by Ricky_Brundritt Friday, March 9, 2012 4:38 PM (From:Bing Maps: Map Control and Web services Development)
    Friday, March 25, 2011 12:23 PM

Answers

  • You should add your on mouseMove event and in your handler, use this command to disable the default behaviour:

    e.handled = true;
    

    It will work as well as you are returning true like this:

    return true;

     

    So basically:

     function GetMap()
         {
          // Initialize the map
          map = new Microsoft.Maps.Map(document.getElementById("myMap"),
                 {credentials:"Bing Maps Key"}); 
    
          //Add handler for the map click event.
          Microsoft.Maps.Events.addHandler(map, 'mousemove', myMouseMoveHandler);
    
    
         }
    
         function myMouseMoveHandler(e) {
    
           // CODE
    
          e.handled = true;
         }

    MVP - Bing Maps - My blog (FR): http://blogs.developpeur.org/nicoboo/ Twitter: http://twitter.com/nicolasboonaert/
    Friday, March 25, 2011 12:52 PM
    Moderator

All replies

  • You should add your on mouseMove event and in your handler, use this command to disable the default behaviour:

    e.handled = true;
    

    It will work as well as you are returning true like this:

    return true;

     

    So basically:

     function GetMap()
         {
          // Initialize the map
          map = new Microsoft.Maps.Map(document.getElementById("myMap"),
                 {credentials:"Bing Maps Key"}); 
    
          //Add handler for the map click event.
          Microsoft.Maps.Events.addHandler(map, 'mousemove', myMouseMoveHandler);
    
    
         }
    
         function myMouseMoveHandler(e) {
    
           // CODE
    
          e.handled = true;
         }

    MVP - Bing Maps - My blog (FR): http://blogs.developpeur.org/nicoboo/ Twitter: http://twitter.com/nicolasboonaert/
    Friday, March 25, 2011 12:52 PM
    Moderator
  • Thanks Nicolas.
    Friday, March 25, 2011 7:41 PM