Drawing Bezier Curved Lines on Bing Maps

In the April 2011 issue of MSDN Magazine I present code that draws a curved line on a Bing Maps map. I also describe how to test the function. If you examine the image at the bottom of this blog you’ll see what I mean. The Bing Maps map shows the Denver, Colorado (USA) area and my code draws a curved line between the University of Colorado (at Boulder) and the Denver airport. See http://msdn.microsoft.com/en-us/magazine/hh205758.aspx for the MSDN article. I like Bing Maps a lot but was surprised that there is no native API to draw a curved line so I researched Bezier curves and translated the logic to a JavaScript function. By the way, in an earlier blog post I presented a technique to draw curved lines on a Bing Maps map using a non-Bezier curve approach; the Bezier curve technique is much better. If you’re new to Bing Maps, be aware that there are different versions: an AJAX version which is the “normal” version that uses AJAX (i.e., JavaScript) to place an interactive map image on a Web page, a Silverlight version (for Silverlight apps), a REST version (for I’m not sure what), and on and on in classic Microsoft API set overkill tradition. Furthermore, the AJAX version of Bing maps has multiple versions including the older v6.3 and the new v7.0, which naturally, is not backward compatible and requires a mildly annoying registration (unlike v6.3). Anyway, working with Bing maps is very cool if you ever have to visualize data on a map.

This entry was posted in Software Test Automation. Bookmark the permalink.