Back to Insights

Trials and tribulations of implementing the Silverlight Bing Maps plug-in

While doing an implementation for a client recently, we learned that there are some important limitations to be aware of when implementing Bing Maps plugins.

The client required a Bing Maps mapping solution that would use pushpins and flyouts to convey additional information about a particular location. There was also the desire to be able to switch back and forth from street view to map view for a particular pushpin.

There were two views that were very important to the client: Streetside and Bird's Eye. Bird's Eye was now available in the AJAX version but Streetside unfortunately was still a Silverlight-only-viewing-mode. The client really wanted to have the option to have Streetside viewing capabilities so this weighted heavily in our decision. After weighing our options we decided to go with Microsoft's Bing Maps Silverlight plugin.

So the decision to use the Silverlight version was based mainly on two key factors:

  • Availability of Streetside and Bird's Eye — Although Bird's Eye was just made available in the AJAX version of the plugin, the ability to view Streetside was only available in the Silverlight version (as a beta extension to the developer SDK).
  • Superior browsing experience — Although Microsoft has vastly improved the performance of the AJAX version of the Bing Maps plugin over previous versions, the zooming and navigation experience still felt clunky in comparison to the experience using the Silverlight version.

Setting up the project

The first challenge was in setting up the project. In order to setup the Silverlight project to use Bing Maps, references to three DLL files need to be added to the project.

  • Microsoft.Maps.MapControl.Common.dll
  • Microsoft.Maps.MapControl.dll
  • Microsoft.Maps.MapControl.ExtendedModes.dll

The first two dll's can be found in the standard Silverlight SDK installation in a folder called "Libraries". The "ExtendedModes" dll is a bit harder to locate. The extended modes dll is actually still in beta for the SDK and is only available for download at Microsoft Connect (you'll probably have to sign up for a free membership if you haven't gotten one already). Also, have a look at this link for details on how to setup a Silverlight Mapping project using Extended Modes.

Once the dlls have been added as references to the project, we were ready to set up the interface and set up how information is passed from the web application to the Silverlight application.

Limitations found in Streetside

One unfortunate consequence that we discovered implementing the Silverlight Bing Maps plugin was that the coverage area of Streetside data provided by Microsoft was quite a bit less than the coverage area provided by Google Streetview. The two images below show the difference in coverage between Streetside and Streetview for Vancouver, BC.

Vancouver Map Bing 

Figure 1 – Bing Maps Streetside Covereage Map for Vancouver, BC

 

Google Map Vancouver

Figure 2 – Google Maps Streeview Coverage Map for Vancouver, BC

 

As can be seen above, the coverage in the downtown of Vancouver and North Vancouver are quite good in Bing Maps, but once you start to explore outside of those downtown cores, the coverage is not there. The amount of coverage that Google provides is quite a bit more.

The two images below show the difference in coverage between Streetside and Streetview for New York City.

New York Map Bing

Figure 3 – Bing Maps Streetside Coverage Map for New York, NY

 

New York Map Google

Figure 4 – Google Maps Streeview Coverage Map for New York, NY

As can be seen above, the coverage for Bing Maps and Google Maps is a lot more comparable for New York than the coverage that was noted for Vancouver.

Since the majority of the client's mapping needs were in and around Vancouver and Victoria and the fact that there was no obvious way through the developer API to determine if Streetside was available for a given latitude and longitude, Streetside ended up not being a practical feature to add to the solution.

Now don't get me wrong, the way Microsoft has implemented Streetside is quite fantastic. The transitions are great and the experience is great (especially in the downtown core of Vancouver where the coverage is quite good). If there was a DetectStreetside(longitude, latitude) method, Streetside would've definitely been included as an option in the final solution, but because there were so many locations in the client's data where Streetside did not cover and due to the timeline of the release, it was ultimately removed from the final solution in favor of Bird's Eye, which could cover everywhere that Streetside could not.

Limitations found in Both Extended Mode Views

Another limitation that was found through our development came to the forefront because the client's site is secure and accessed through HTTPS. There are no issues with the Road or Terrain views, but mixed mode messaging (accessing insecure content from a secure connection) appear in both IE7 and IE8 if the Silverlight application accesses Extended Mode functionality in any way. This messaging will appear in any of the Bing Maps viewing modes as long as Extended Mode functionality is accessed.

We also discovered that although the mixed mode messaging did occur in FireFox v4, it didn't seem to affect retrieval of extended mode map data. It was a different story in IE7 and IE8 where the imagery wasn't delivered at all. We looked more into the issue and discovered that internally they refer to imagery links using HTTP to take advantage of caching on the caching servers. A redesign on Microsoft's side would be required to avoid mixed mode messaging.

Lack of Built-in Flyout Functionality

Another limitation that we found in porting over our solution to Silverlight was that the Silverlight API did not provide pushpin flyout hover functionality out of the box. From previously working with the AJAX Bing Maps plugin (which provides simple flyout functionality by default), I was very surprised to find this missing from the Silverlight implementation. There are many blog posts out there that address adding this functionality manually to Silverlight so they were definitely helpful guides to adding this missing functionality to our implementation. The lack of a flyout is mentioned in this forum thread.

A Proposed Solution

With all the aforementioned limitations noted we worked with the client to deliver a solution that met the vast majority of their needs with a Silverlight solution to take advantage of the smoother viewing experience that Silverlight gives us.

Reduced Coverage for Streetside in Specific Areas of Interest

Due to the reduced coverage in the Vancouver area for Bing Maps in comparison with Google Maps and the lack of a Streetside check to determine if Streetside imagery was available given a pushpin location, we decided to replace Streetside functionality with the Bird's Eye functionality. Streetside was fantastic in areas where there's coverage but there were too many areas where our client needed Streetside and it wasn't available to be worth including this mode as a feature. Bird's Eye was deemed to be a very good replacement for Streetside because viewers get to see a realistic projection view of the area that terrain viewing only hints.

Lack of a Build-in Flyout Functionality

Due to the lack of a built-in flyout while hovering over pushpins we created this functionality ourselves manually in the Silverlight code in order to deliver this required functionality. We used a <border> component containing a <grid> which we used to populate the content of the flyout with each pushpin's saved metadata which was hidden/shown based on the user hovering over a pushpin. We also positioned the flyout smartly to ensure that it was always visible on the screen no matter where the pushpin was located in relation to the edges of the viewport.

Mixed Mode Messaging Issues

The mixed mode security messages and the inability to retrieve both Bird's Eye and Streetside imagery through an HTTPS website provided a challenge as well. In the end, we restricted the mapping component within the HTTPS site to just allowing terrain and road mode viewing so that the users of the site could get the benefit of the pushpins and associated metadata information. We provided a link within the flyout that appears while hovering over a pushpin to view that pushpin in Bird's Eye view. The link within the flyout would open the Silverlight object in a new window accessing the page through HTTP instead of HTTPS, which addressed this issue.

By using this method we were able to provide road and terrain map viewing with all of the pushpins within the HTTPS site and allow the user to retrieve the location-centered Bird's Eye view of a particular point if desired.

Conclusion

We were able to work through the limitations provided by the Silverlight Bing Maps plugin and provide a solution that met the vast majority of our client's needs on a very tight time frame. Here's a summary of the benefits and limitations that we faced when developing this application.

Benefits of the Silverlight Bing Maps Plugin:

  • Superior map navigation experience (very smooth, very responsive)
  • Access to Bird's Eye view functionality
  • Access to Streetside view functionality

Limitations that were overcome:

  • Created a custom made flyout — as the out of the box Silverlight plugin didn't include that functionality
  • Avoided mixed security protocol messaging by accessing Bird's Eye View through HTTP while the rest of the functionality was accessed through HTTPS

Limitations that weren't overcome

  • Limitations in Streetside data coverage and availability, in addition to a lack of any way in the SDK to determine where Streetside views were available, forced us to use Bird's Eye View because it was available everywhere.

Microsoft's current development efforts with Bing Maps seem to reflect that their focus has indeed been shifted from the Silverlight plugin to the AJAX plugin for now. The latest release of the AJAX plugin started to address the vast performance differences between the Silverlight plugin and the AJAX plugin (they are much smaller now) and added the Bird's Eye view mode which was previously only available in the Silverlight version.

In addition Microsoft has updated its main Bing Maps site with an AJAX only version (check it out here), which includes a Streetside substitution called Microsoft Streetside (announced by blog post here). This version definitely doesn't replace the fantastic and immersive Streetside experience that the Silverlight plugin provides, but it does prove that Microsoft is definitely exploring different methods and options in their development. The Silverlight version of Bing Maps can still be found here.

I'm definitely looking forward to seeing what Microsoft offers next in upcoming updates to the AJAX version of the plugin in the SDK.

Share