Answered Bing maps WPF "scaled object" question

  • Tuesday, February 14, 2012 8:10 AM
     
     

    Hello!

    I've started developing an application which uses Bing maps control for WPF. But the problem is that I need to add circles of defined radius (in kilometres) on the map at defined lat/lon. So that when I zoom out - the circle of 10km radius should become a little dot. Is there any possibilities to do it or will it be included into further versions of Bing Maps Control?

    I've already tried some "strict" methods - like using zoomLevel and MetersPerPixel properties for calculations, but failed to do it.

    Best regards,

    Nikita

All Replies

  • Wednesday, February 15, 2012 9:50 AM
    Owner
     
     Answered
    There has been a ton of forum posts on creating circles for the other Bing Maps controls. The method for doing this in WPF is the same as any other control. You need to calculate out the coordinates for the circle and then use the MapPolygon or MapPolyline classes. WPF shapes Rectangle, Circle, etc will not scale in Bing Maps as they don't have the logic for that. Here is some sample code using the Silverlight control: http://pietschsoft.com/post/2010/06/28/Silverlight-Bing-Maps-Draw-Circle-Around-Latitude-Longitude-Location.aspx this should work with the WPF control as well.

    http://rbrundritt.wordpress.com

    • Marked As Answer by _Nikkitta_ Wednesday, February 15, 2012 6:39 PM
    •  
  • Wednesday, February 15, 2012 6:40 PM
     
     
    Thanks a lot, it worked!