Home » Windows LiveRSS

Map Control v7 Mouse wheel and Double Click not zooming properly

We have a simple map that displays pins on our search results page.  The map renders and displays pins just fine but zooming with either double-click or the mouse wheel causes weird behavior with the zoom.  The map will zoom above (sometimes WAY above) were you clicked or where your mouse was when you moved the wheel.

 

I have maps on other pages where the double click zoom and mouse wheel function properly and I have moved this map to a page by itself and it functions properly.

 

Is it possible that there is some sort of CSS or javascript issue that could causes this behavior? (I've tried turning off the stylesheets on this page to no avail)

Has anyone else ever seen this behavior?

 

3 Solutions Found

 

Solution 1

v7 should be less susceptible to conflicts with other javascript libraries etc. since all of the classes are now contained within the Microsoft.Maps namespace, but there's still scope for interference when you're listening for mouse or keyboard events. Unfortunately, it sounds like it's going to be a difficult problem for anyone to help with if, when you copy the map into a page on its own, it functions correctly! Perhaps you could gradually try to add back in the other elements of the page, and see at which point the map starts to behave incorrectly? What OS/Browser are you using? Can you confirm the behaviour using a different browser?
 

Solution 2

can you explain mouse wheel a little bit. It seems double click bug is notified to the team.
 

Solution 3

I get the same result in FF 3.6, IE 8, and Chrome 8.0

Doing a little more investigating into the issue I noticed that if I took a block of html from able the map (it was a unordered list is links) the double clicking and zooming would work fine.  However, I found this to be inconsistent.  Namely, I would remove the block, the zoom would work, I would add the block back in the zoom wouldn't work, I would take the block out and the zoom wouldn't work.

Looking for a potential answer, I overrode my doubleclick function with this, hoping to see a pattern:

MM.Events.addHandler(map,"dblclick",handleDC);

function handleDC(e)
{
   var loc = map.tryPixelToLocation(new MM.Point(e.getX(),e.getY()));
   var pin = new MM.Pushpin(loc);
   pinLayer.push(pin);                   
   e.handled = true;               

}

What I saw was that the pin was consistently being placed above where I clicked.  What was not consistent however was just how far above it was getting placed.  The distance it was off appears to be random with each load of the page.

My best guess is something is interfering with the maps ability to determine the exact location of the mouse cursor, what or how is a beyond me.

 

 
 
 
 
Tagged:
                          
 

<< Previous      Next >>


Microsoft   |   Windows   |   Vista   |   Programming   |   Technology   |   Follow us on Twitter   |   Copyright 2008-2010. All rights reserved