title: Is there any way to make a MapPolyline have better performance on WP7
body: <p>I'm currently using the Silverlight Map control for WP7, and am trying to visualize driving directions on the map. In order to highlight the route needed, I am using a <code>MapLayer</code> with a <code>MapPolyline</code>. The problem is that even with <code>CacheMode</code> set to <code>BitmapCache</code>, the MapPolyline area gets redrawn whenever the user pans or zooms the map. I've used other controls such as Ellipses or Pushpins, and with BitmapCache on, none of them redraw and give the same performance hit as MapPolyline.</p>
  
  <p>Here's a quick example</p>
  
  <pre><code>    &lt;maps:Map ZoomLevel="3"&gt;
          &lt;maps:MapPolyline Name="line" Stroke="Red" StrokeThickness="9"&gt;
              &lt;maps:MapPolyline.CacheMode&gt;
                  &lt;BitmapCache/&gt;
              &lt;/maps:MapPolyline.CacheMode&gt;
              &lt;maps:MapPolyline.Locations&gt;
                  &lt;maps:LocationCollection&gt;
                      &lt;geo:GeoCoordinate Latitude="33" Longitude="33"/&gt;
                      &lt;geo:GeoCoordinate Latitude="36" Longitude="33"/&gt;
                      &lt;geo:GeoCoordinate Latitude="33" Longitude="36"/&gt;
                  &lt;/maps:LocationCollection&gt;
              &lt;/maps:MapPolyline.Locations&gt;
          &lt;/maps:MapPolyline&gt;       
      &lt;/maps:Map&gt;
  </code></pre>
  
  <p>If you set <code>App.Current.Host.Settings.EnableRedrawRegions = true;</code> you can see the redrawing that occurs. The performance is particularly bad when you have a larger polyline and zoom in closer.</p>
  
  <p>Is there anything that can be done to help? The native Bing Maps has pretty smooth route drawing, so I would think that there should be a way to solve this?</p>
  
  <p>Thanks!</p>