1

I am using the Silverlight Bing Maps control in an application. There is a canvas hosted over the map with various UIElements.

A problem I am currently observing is the map mouse-down pans the map correctly, unless the mouse-down originates on a UIElement (Element in question is a MapPolyLine).

UIElements are added to the map with the following code

        var outlineBottom = new MapPolyline {
            Stroke = new SolidColorBrush(bottomColor),
            StrokeThickness = width * TrailBottomLineWidthMultiplier,
            Opacity = 1, //opacity,
            StrokeMiterLimit = 1,
            Locations = locations
        };

This results in a poly line of thickness ~5px being added to the map. When the user mouse-downs on the map but the mouse pointer is over the line, it cannot be panned.

How can I stop the MapPolyline above swallowing mouse events so the map can be panned?

Dave Clemmer
  • 3,741
  • 12
  • 49
  • 72
Dr. Andrew Burnett-Thompson
  • 20,980
  • 8
  • 88
  • 178

1 Answers1

3

Try setting UIElement.IsHitTestVisible = false on your MapPolyline.

ColinE
  • 68,894
  • 15
  • 164
  • 232