Select to view content in your preferred language

Strange map behavoir - map moves with mouse

780
3
09-07-2010 07:31 AM
CameronKuykendall
Emerging Contributor
I am experiencing some strange behavior.  I have searched the forums for a similar post and only found the same issue in the javascript sub forum.  At times when I double click a Graphic quickly and then move the mouse, the map will then pan in the opposite direction of the movement of the mouse.  It doesn't happen often, but I can reproduce it after a few attempts.  Any ideas?
0 Kudos
3 Replies
LewLadd
Deactivated User
I had a similar issue. Are you attaching a listener to the graphics mouse down event?

I had to add a handler to the graphicsLayer's MouseLeftButtonDown event:

graphicsLayer.MouseLeftButtonDown += new GraphicsLayer.MouseButtonEventHandler(graphicsLayer_MouseLeftButtonDown);

And in there set e.Handled to true:

void graphicsLayer_MouseLeftButtonDown(object sender, GraphicMouseButtonEventArgs e)
        {
            e.Handled = true; // Prevent 'sticky' pan.
            raiseGraphicClicked(e.Graphic);           
        }
0 Kudos
CameronKuykendall
Emerging Contributor
I am doing that, but setting handled to true did not correct the issue unfortuneately.
0 Kudos
ShenglinXu1
Deactivated User
I am using Silverlight API 4 and got the issue. set e.Handled = true works for me. Thanks!
0 Kudos