Interactive Mapping Blog

Mapping Solutions News

Archive for the ‘Bing Maps’ Category

AJAX Mapping APIs – Google Maps vs Bing Maps: UPDATE Pushpin Display Performance

Tuesday, February 22nd, 2011

In the last six months, both Bing Maps and Google Maps have released new versions of their AJAX map controls. In this blog article we will compare the performance of each platform when displaying an increasing number of pushpins.

As this test is greatly affected by the browser you are using, we are using the latest (at the time of testing), non-beta, version of each of the major browsers. We have tested Bing Maps version 7, Bing Maps version 6.3 and Google Maps 3 allowing us to compare both the progress of the Bing Maps platform and the Google Maps platform.

The test conducted recorded how long it takes to add 1, 10, 100, 500 and 1000 pushpins to the map. Whilst plotting 1,000 pushpins on the map is probably not a sensible idea from a usability point of view, it does help demonstrate how well each platform reacts under pressure.

image

image

image

These charts clearly demonstrate that Bing Maps version 7 is a significant improvement in performance over its predecessor and in addition is also significantly faster than Google Maps version 3 when showing over 100 pushpins. It clearly demonstrates that irrespective of the browser, the performance order of the mapping platforms is consistent with Bing Maps version 7 outperforming the other versions in the test (and especially so in Chrome 5.0).

One aspect these test results do not demonstrate is the that we noticed that there is a considerable delay between the time the platform says that it takes to complete the task, and when the user actually sees pushpins appear on the map. Whilst this is true for Bing Maps it is considerably worse in Google Maps.

What do these results show?

Although the performance factor compared in this tests is not the only performance factor worthy of consideration (see our previous article on download size for another), these results are clearly indicative of relative performance. If performance is a key factor when choosing a mapping platform, these results would certainly indicate that the recent commitment by the Bing Maps development team to improve performance means that Bing Maps appears to lead the way in AJAX mapping platforms compared with Google Maps .

Try these tests for yourself

If you want to try the map data loading tests for yourself on your own machine the source code is available to download at http://mapperftests.codeplex.com

Mapping APIs – Google Maps vs Bing Maps: UPDATE API Download Sizes

Friday, December 10th, 2010

Almost a year ago we wrote an article about the download speeds and sizes of the competing map apis, as part of a series comparing the Ajax APIs for Google Maps and Bing maps, since then a lot has changed.

Google have updated their offering with the depreciation of Google Maps ver 2 and the continued development of Google Maps ver 3 focusing on smaller download sizes and support for mobile devices. Bing Maps meanwhile in the last 12 months have released one minor version (6.3) and one major version (7) of their map control.

So its time to see if things have changed since last time, when Google Maps took the crown for initial download size. We will be testing both the old versions of the APIs and the new versions to show what progress has been made by both companies.

Download Size

This test will just measure the download size of any javascript, image and css required to get a basic map loaded. It will ignore the map imagery itself as that can vary so much on different locations and is probably best left for another article.

image

As you can see some interesting things have happened in the last 10 months:

  1. Google Maps Ver 3 has grown considerably from our last test when it less than 50k. Now at 88kb as they have added more of the features originally missing from the first releases of ver 3.
  2. Bing Maps 6.3c “core” control is a great improvement on the full 6.3 clocking in at 76kb. Its also smaller than either of the Google Maps controls
  3. Bing Maps 7 has obviously had a complete rebuild as it now clocks in at 65kb, the smallest of any of the map controls, but at what price?

Digging a Little Deeper

The updated results are very interesting, but they do not really tell the whole story as all the new APIs have a few gotchas, and tricks up their sleeves.

Bing Maps 6.3 “core”

The new lite version of the Bing Maps 6.3 API is a great improvement for those looking for fast loading maps and it is now pretty comparable to Google Maps, however this comes at a cost. The core version can only be used for the most basic of pushpin maps and does not contain support for things like routing, geocoding or polygons (amongst other things). You can get a better idea of what exactly is supported here on MSDN.

Google Maps Ver 3

The new version of Google Maps, ver 3, also has a slightly misleading trick up its sleeve, but a very welcome one. The initial download size is one of the best of the fully featured API’s however it doesn’t tell the full story.

Google have very cleverly made their API modular allowing you to add one script reference but it to dynamically load other scripts if your code requires them. This means for a very simple ‘pushpin on a map’ example as we tested here very little code is required so the download is very small. However load a more complex example like this and quickly the javascript size grows to 471kb. If you have a complex map, requiring lots of functionality its very likely Google Maps ver 3 will get near to the size of the Bing Maps ver 3 download size.

So Google have come up with a great little trick for loading their map API for which they should be congratulated. Its the best of both worlds really, you get a nice fast loading map when your requirements are simple, and a slower experience when you need all the bells and whistles. Although you get a similar experience with the Bing Maps 6.3 and 6.3 core versions its no where near as clever or seamless to integrate.

Bing Maps 7

Similar to the previous 6.3 core control, the Bing Maps 7 control is also a little lite on features, for example there is no geocoding, routing, popup boxes and some controls are less feature rich than before for example the pushpin control no longer accepts html content.

There are some new features though including much better mobile support and multi-touch support for i0S devices.

Bing Maps 7 also seems to feature some kind of modular framework, although currently only splitting the control into 2 files. We hope to see the Bing team follow Google’s lead and add the missing features (that were in 6.3) into the ver 7 control using a modular on-demand approach especially for the map popup control.

Summing it all up

So both API’s have made some great improvements to their  initial download sizes. Bing have released a two great versions of their API and now hold the smallest download crown, and Google have implemented some clever loading on demand technology. We will leave it to you to decide if initial loading size is an issue for your application and there are certainly different choices to make depending on the functionality you require.

Come back soon to see our next article comparing the speed of the API’s at various common tasks.

OFFICIAL Microsoft Bing Maps community event in the UK 27th October

Wednesday, October 20th, 2010

We have been working behind the scenes with Bing’s PR agency 3-Monkeys, on an official Microsoft Bing Maps community event for the UK and you can now sign up to attend next Wednesday 27th October. Here’s the intro:

“Bing invites you to an informal panel discussion and Q&A to hear the latest from Bing Maps UK and how it has been working with leading digital partners to deliver improved map services for consumers and develop innovative mapping solutions for many high profile clients. This is your chance to hear from our expert panel of mapping specialists, who will discuss the latest in mapping technologies and be on hand to answer your questions. “

For full details of who is talking, other than Brian Norman our resident Bing Maps MVP, please see the event site where you can sign up:

http://bingmapsuk.eventbrite.com

Using Jquery with the Bing Maps REST API

Sunday, October 10th, 2010

In the last few months Bing Maps have released a new version of the web services (previously available as SOAP). This new version uses the increasingly popular REST format which for the first time allows us to use these services direct from javascript on the clients browser.

If you are creating rich, client side applications, using Jquery then these new REST APIs are a great way to do various mapping related tasks without having to load data from your own server side code. In this article we will show you a simple example of geocoding (finding a physical geographical location from its address or name) using Jquery and the Bing Maps REST API.

Getting started

To get started you need to create a simple HTML page and have the Bing Maps REST API reference site open for the location service  (http://msdn.microsoft.com/en-us/library/ff701715.aspx).

The first thing we need to do is add the script reference to the latest version of Jquery, in this case we are loading it from the Google CDN.

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" >
  3. <head>
  4.     <title>Bing Maps REST with Jquery</title>
  5.     <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
  6. </head>
  7. <body>
  8.  
  9. </body>
  10. </html>

 

Now we need to add a textbox for the user to type their location in, and a button to submit the user request.

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" >
  3. <head>
  4.     <title>Bing Maps REST with Jquery</title>
  5.     <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
  6. </head>
  7. <body>
  8.     <label for="myaddress">Type an address:</label>
  9.     <input type="text" id="txtAddress" />
  10.     <input type="button" id="btnSearch" value="Find Location" />
  11. </body>
  12. </html>

 

Now we need to add somewhere to display the results of our query.

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" >
  3. <head>
  4.     <title>Bing Maps REST with Jquery</title>
  5.     <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
  6. </head>
  7. <body>
  8.     <label for="myaddress">Type an address:</label>
  9.     <input type="text" id="txtAddress" />
  10.     <input type="button" id="btnSearch" value="Find Location" />
  11.     <p id="results"></p>
  12. </body>
  13. </html>

 

Wiring things up

Now we have the basic page created we need to start using Jquery to wire everything up. Lets start by adding the basic jquery to wire up a click event to the button on page load. For the sake of readability we will miss out most of the HTML in the snippet below.

  1. <script type="text/javascript">
  2.     $(document).ready(function () {
  3.         $("#btnSearch").click(function () {
  4.             
  5.         });
  6.     });
  7. </script>

now comes the clever bit, we need to use Jquery’s getJSON method to request the location information from the Bing Maps REST API for the address the user has entered. The getJSON method is pretty simple and has the following signature:

jQuery.getJSON( url, [ data ], [ callback(data, textStatus) ] )

url – A string containing the URL to which the request is sent.

data – A map or string that is sent to the server with the request.

callback(data, textStatus) – A callback function that is executed if the request succeeds.

So the code to call the Bing Maps REST API to query the location of an non-structured address using the following url

http://dev.virtualearth.net/REST/v1/Locations/query?key=BingMapsKey

You’ll notice you will need to put your own Bing Maps key into the url which you can get from http://www.bingmapsportal.com/. Here is the code we need to make the call in Jquery.

  1. $(document).ready(function () {
  2.     $("#btnSearch").click(function () {
  3.         //check user has entered something first
  4.         if ($("#txtAddress").val().length > 0) {
  5.             //send location query to bing maps REST api
  6.             $.getJSON('http://dev.virtualearth.net/REST/v1/Locations?query=' + $("#txtAddress").val() + '&key=YOURBINGMAPSKEY&jsonp=?', function(result) {
  7.                 alert("got a result");
  8.             });
  9.         }
  10.         else {
  11.             $("#results").html("please enter an address");
  12.         }
  13.     });
  14. });

 

The important parts to notice are how we construct the call to Jquery’s getJSON method. The first parameter to the call is the url to load json data from, in this case we are building the url string up to include the value the user has entered in the textbox.

The critical part of this url is the addition of the “&jsonp=?” to the end of the url, this allow jquery to create a proxy allowing your code to make a cross domain call to a different url than the one the page is running on. Without this javascript would not be able to make the call to the Bing Maps REST API. The “?” is where jquery does its magic and behind the scenes wires up your success callback code (the second parameter) and the callback that is sent to the Bing Maps REST API.

As we just mentioned the second parameter is the function you want to be called when the result successfully comes back.For now this code will just show an message box but now to actually read in the data.

Reading the data returned

The data returned by the location service is quite complex and its easier to explore using a tool like firebug (the firefox plugin) or IE or chromes built in javascript debuggers. Here is a screen shot of what the data looks like returned from this call.

bingmapsreturned

As you can see you may get more than one “resources” object back if your address could match more than one place in the world. In this example we will just use the first result returned, but in real life you would want to present the user with a list of the possible options to choose from.

So the last bit of code to check if we have a result, and then write out the latitude and longitude of the location is as follows.

  1. $(document).ready(function () {
  2.     $("#btnSearch").click(function () {
  3.         //check user has entered something first
  4.         if ($("#txtAddress").val().length > 0) {
  5.             //send location query to bing maps REST api
  6.             $.getJSON('http://dev.virtualearth.net/REST/v1/Locations?query=' + $("#txtAddress").val() + '&key=YOURBINGMAPSKEY&jsonp=?', function (result) {
  7.                 if (result.resourceSets[0].estimatedTotal > 0) {
  8.                     var loc = result.resourceSets[0].resources[0].point.coordinates;
  9.                     $("#results").html('latitude:' + loc[0] + ', longitude:' + loc[1]);
  10.                 }
  11.                 else {
  12.                     $("#results").html("sorry that address cannot be found");
  13.                 }
  14.             });
  15.         }
  16.         else {
  17.             $("#results").html("please enter an address");
  18.         }
  19.     });
  20. });

Summary

This simple example has hopefully shown you just how easy it is to call the Bing Maps REST webservices using Jquery, and just how little code is required for a completely cross browser solution.

To try it out for yourself, download the code using the link below and add your own bing maps key

.butdownloadcode[1]

GoLearnTo continues to show how to place technology at the heart of the online experience

Thursday, August 12th, 2010

Now in our fourth year of partnership with GoLearnTo.com we are delighted that the website we have been involved in developing continues to go from strength to strength. In the last month GoLearnTo has added no less than four awards and nominations to their impressive array of successes including…

GoLearnTo.com

Tongue Twister

The International Association of Language Centres has voted GoLearnTo.com agency of the month recognising them as a leading language travel agency. The IALC recognize the quality and teaching standards of GoLearnTo.com’s range of courses where you can learn Spanish in Spain or learn French in France and over 14 more languages worldwide.

Best holiday experience provider…

GoLearnTo.com have been nominated for a British Travel award in the category ‘Best Holiday Experience Provider’. It’s a great honour to be nominated for the 2nd year running proving there’s no stopping the public’s appetite for learning new skills on holiday.

Best new agency…

Language schools from over 30 countries worldwide have voted for GoLearnTo.com in the best new agency category for Language Travel Magazine’s star awards. GoLearnTo.com has been specially recognized as a ‘star’ agency for their work to make language learning more fun and a holiday activity by combining languages with a unique range of fun activities such as cookery holidays in Italy, yoga holidays or even surfing, dancing, horse riding and much more.

And the website of the year goes to…

GoLearnTo hope to be in with a chance of winning the Good Web Guide’s Website of the Year Award after being nominated this year.

This proves once again how an aesthetically pleasing, functionally rich and easy to use website designed and developed by The Technology Studio with maps by Earthware can do for you.

We are also really excited to be working on a potentially groundbreaking project with GoLearnTo using Microsoft Silverlight and Bing Maps to offer a rich multimedia experience all within a map – watch this space!

Earthware’s CountryBehindTheCup map is discussed on C21 Media.net

Wednesday, June 23rd, 2010

Earthware’s Avimap demos (TheWorldCupMap and CountryBehindTheCup) are being noticed left right and centre with the latest review coming from C21 Media.net, the digital publishers who broadcast all things television business news and information related.  

Read their full article about CountryBehindTheCup here

Earthware’s TheWorldCupMap has grown and now includes CountryBehindTheCup map

Tuesday, June 22nd, 2010

Regular readers of our blog will have heard about Earthware’s TheWorldCupMap which we launched at the beginning of the 2010 World Cup football tournament. This week has seen our newest addition to the map, CountryBehindTheCup, being launched.

CountryBehindTheCupContinuing our partnership with Skyworks, the company behind the high definition video footage of the football stadiums shown in TheWorldCupMap, the CountryBehindTheCup map features Skyworks’ HD video documentary originally made for TV which gives a factual tour of South Africa the country, rather than South Africa the country hosting the World Cup.

The video footage has been combined with Bing Maps Silverlight technology in the same way as TheWorldCupMap did to create an aerial journey across South Africa giving an example of the ‘art of the possible’ of how any geographical data (text, images and video) can be combined with online mapping to create an interactive and visually engaging experience to the user.

This technology has great potential to change the way people research holidays online – imagine using a travel map which contains similar video, plus images and text, to investigate the location where you are planning to spend your next break. Suddenly your research has become a whole lot easier.

For further information about displaying your data on a web based map or to see how travel maps could help your agency differentiate themselves please contact Earthware on 0845 642 9880 or email info@earthware.co.uk

Bing Maps Silverlight – smooth zoom skydive animation

Monday, June 21st, 2010

Have you ever wondered what it would be like to leap out of an aircraft near the edge of space and plummet to earth ? Austrian skydiver Felix Baumgartner hopes to make an attempt later in 2010, travelling the 23 miles at eye-watering super-sonic speeds.

[http://www.space.com/news/highest-parachute-jump-supersonic-100126.html]

For the rest of us there is the Silverlight Bing Maps Control. Not quite as glamorous but, equally not as uncomfortable.

This sounds like a rather simple Silverlight application, create a map, start zoomed out from your landing point and then smoothly animate the ZoomLevel parameter to ‘plummet’ to earth. The problem is that the default map animation moves too quickly and you cannot animate the Map controls ZoomLevel property yourself from a Storyboard, as Storyboard animations only operate on DependencyProperties.

ZoomLevel is not the only value that developers have needed to animate in past that has not been a DependencyProperty. The solution is to set the Storyboard animation to target your own class member as a DependencyProperty which in turn can modify your intended object member.

Code Snippet
  1. <Storyboard x:Name="ZoomIn">
  2.     <DoubleAnimation x:Name="ZoomLevel"
  3.                     Storyboard.TargetName="MainMap"  
  4.                     From="3.0"
  5.                     To="5.0"
  6.                     Duration="0:0:9" />
  7. </Storyboard>

Within your Silverlight control constructor.

Code Snippet
  1. Storyboard.SetTargetProperty(ZoomLevel,
  2.     new PropertyPath(
  3.         Attachments.MapZoomLevelProperty
  4.         )
  5.     );

Handy Attachments utility class

Code Snippet
  1. public partial class Attachments
  2. {
  3.     // Map Zoom level property
  4.     public static readonly DependencyProperty
  5.         MapZoomLevelProperty =
  6.         DependencyProperty.RegisterAttached("MapZoomLevel",
  7.         typeof(double), typeof(Attachments),
  8.         new PropertyMetadata(
  9.             new PropertyChangedCallback(OnMapZoomLevelChanged)));
  10.  
  11.     public static void SetMapZoomLevel(DependencyObject o,
  12.         double value)
  13.     {
  14.         o.SetValue(MapZoomLevelProperty, value);
  15.     }
  16.  
  17.     public static double GetMapZoomLevel(DependencyObject o)
  18.     {
  19.         return (double)o.GetValue(MapZoomLevelProperty);
  20.     }
  21.  
  22.     private static void OnMapZoomLevelChanged(DependencyObject d,
  23.         DependencyPropertyChangedEventArgs e)
  24.     {
  25.         double z = (double)((Map)d).ZoomLevel;
  26.         z = (double)e.NewValue;
  27.         ((Map)d).ZoomLevel = z;
  28.     }
  29. }

 

Most of this was gleaned from [http://www.conceptdevelopment.net/Silverlight/VEMap05/] and [http://bryantlikes.com/archive/2009/03/23/animation-hack-using-attached-properties-in-silverlight.aspx]

Just to make things a little more realistic the Map object centre Location property can be animated to provide wind shear.Instead of animating the Latitude and Longitude separately a Point based DependencyProperty can be created.

Code Snippet
  1. <Storyboard x:Name="CenterMap">
  2.     <PointAnimation
  3.        x:Name="CenterPoint"
  4.            Storyboard.TargetName="MainMap"
  5.            From="5.0,50.0"
  6.            To="-8.0,56.0"
  7.            Duration="0:0:14" />
  8. </Storyboard>

Within your Silverlight control constructor.

Code Snippet
  1. Storyboard.SetTargetProperty(CenterPoint,
  2.     new PropertyPath(
  3.         Attachments.MapCenterPositionProperty
  4.         )
  5.     );

New property for the Attachments utility class

Code Snippet
  1. // Map Center Position Property as a Point
  2. public static readonly DependencyProperty
  3.     MapCenterPositionProperty =
  4.     DependencyProperty.RegisterAttached(
  5.         "MapCenterPosition",
  6.         typeof(Point),
  7.         typeof(Attachments),
  8.     new PropertyMetadata(
  9.         new PropertyChangedCallback(
  10.             OnMapCenterPositionChanged)));
  11.  
  12. public static void SetMapCenterPosition(
  13.     DependencyObject o, Point value)
  14. {
  15.     o.SetValue(MapCenterPositionProperty, value);
  16. }
  17.  
  18. public static Point GetMapCenterPosition(
  19.     DependencyObject o)
  20. {
  21.     return (Point)o.GetValue(MapCenterPositionProperty);
  22. }
  23.  
  24. private static void OnMapCenterPositionChanged(
  25.     DependencyObject d,
  26.     DependencyPropertyChangedEventArgs e)
  27. {
  28.     Location l = (Location)((Map)d).GetValue(
  29.         Map.CenterProperty);
  30.     Point p = new Point(l.Latitude, l.Longitude);
  31.     p = (Point)e.NewValue;
  32.     double z = (double)((Map)d).ZoomLevel;
  33.     // Y is Latitude, X is Longitude        
  34.     ((Map)d).SetView(new Location(p.Y, p.X), z);
  35. }

Now clip the Map to a circle and animate the containers Angle with a regular DoubleAnimation to create a truly sickening spiralling to the ground experience.

 skydive2 skydive3

The smooth zooming and panning was used to great effect to navigate around the South Africa world cup football stadiums in time with HD video in our World Cup map http://www.theworldcupmap.com

start skydive demo download SkyDive project

Tutorial – An overview to developing Bing Map Apps

Thursday, June 17th, 2010

This is our first screen cast in a series showing how to develop your own Bing Maps App using the recently released Bing Maps App SDK. If you are interested in developing Bing Map Apps for your company or clients and want to get an overview of what they are and how they work then check out the screen cast below. If you want to find out more about Bing Map Apps development please get in touch.

We recommend clicking the HD button on the video below to view the screen cast on vimeo in HD

TheWorldCupMap, Earthware’s Avimap demo, is being promoted up by the BBC

Tuesday, June 15th, 2010

It seems that we are not the only people who think that TheWorldCupMap, Earthware’s tour of TheWorldCupMap on the BBC Sport website the World Cup stadiums, is pretty cool. The guys at BBC sport also agree and have added it to their dedicated World Cup page alongside their own venue guide and Fifa’s offering too. It’s great to have our work recognised in this way and to see this amazing new technology being used so well.

TheWorldCupMap shows what the ‘art of the possible’ of online mapping is. It is the world’s first release of Aerial Video Integrated Mapping (Avimap) technology which combines the Bing Maps Silverlight mapping API, the latest Internet Information Services (IIS) smooth streaming technology and Windows Azure cloud hosting to give a movie-like experience of a location. 

If you would like more information about how you could use the latest web mapping technology to display your business information in a compelling way please contact Earthware on 0845 642 9880 or email info@earthware.co.uk