.Net Development & General Tech Related News

Bing Silverlight Control with the Bing Web Service Application

May 19th, 2010 Posted in .Net, C#, Silverlight

After reading Carl Dickinson’s post on Mando Group Labs about the Bing Silverlight Control, I wanted to give it a try myself.

I decided to set about using the Bing Silverlight control to display available hotels from LateRooms.com.  LateRooms.com have an affiliate scheme that exposes the availability of hotels via XML feeds (you do need an affiliate ID to use the feeds but this could easily be replaced by any other similar feed).

You can view the sample app I have created here (note: LateRooms has mostly UK hotels so probably best trying a UK location, e.g. “Southport UK”). 

To create the app I create added four controls to my page;  

  • Bing Silverlight Control – This is obviously the main focus of the app.
  • A text box and a button to accept a location from the user and start the request to get the hotels.
  • A list box to display a picture, the name and the first line of the address for each of the hotels.

Once the user enters a location into the text box and clicks the button the following happens;

  • The location entered by the user is sent to the Bing Geocode web service and providing it can find a match it returns the lattitude and longitude for the location.
  • This map is then centred on this location.
  • Finally the newly returned coordinates are used to get a list of available hotels from the LateRooms XML feed. This list is then iterated through and a pin for each hotel is added to the map and the list is then bound to the list box.

Finally I added an event handler to the selection changed event of the list box to re-centre the map on the coordinates of the selected hotel.

There is plently more that could be done with this app, not least making the UI a little more attractive, but I wanted to just get a feel of how easy it was to implement some basic Bing maps functionality in Silverlight.

If you are interested to see the source code to the application let me know and I can post it.  Right now I am off to try some more experiments!

Don’t forget if you liked this, subscribe to my RSS feed and / or follow my Twitter (links at the top of the page).


Kick It on DotNetKicks.com
Share this Post:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DotNetKicks
  • Reddit
  • StumbleUpon
  • TwitThis
No TweetBacks yet. (Be the first to Tweet this post)

Technorati Tags: ,

Tags: ,

  1. 2 Responses to “Bing Silverlight Control with the Bing Web Service Application”

  2. By Fabian on Jul 7, 2010

    I’d love to take a look at your code for this project.

  3. By Gary Pretty on Jul 14, 2010

    Hi Fabian,

    The best thing to do to see some of the code involved with this project is to read one of my posts over at Mando Group Labs, the agency where I work, where I have started a series of posts about building Bing Maps route planning apps using the various Bing web services. All the source code is available and you can check it out here, http://labs.mandogroup.com/plan-a-route-with-the-bing-maps-silverlight-control-and-bing-services-part-1/.

Post a Comment