Bing Maps v7 control -New Version

It seems that, in the last few hours, Microsoft have pushed out a new release of the Bing Maps AJAX control (or, maybe their content delivery network has only just started serving a new version – the timestamp attached to the library URL, http://ecn.dev.virtualearth.net/mapcontrol/v7.0/js/bin/7.0.20110426171249.81/en-us/veapicore.js, suggests that it may have been compiled 10 days ago, on 26th April 2011).

This is a minor release – it’s not version 7.1 – so you wouldn’t normally expect to see much in the way of new features. However, it is significant since it appears to resolve a fairly crippling bug that previously made the map control unusable if instantiated in a container of the page that was not visible on initial load (i.e. if you wanted your map to be absolutely positioned in a div near the bottom of a long page that required the user to scroll to get to it).

There is also at least one change made to the default behaviour of the map, in that panning now exhibits an inertia effect – the map does not abruptly stop when you release the mouse button after panning, but slides to a gradual standstill. This change follows the trend of a lot of previous enhancements to v7, in making the AJAX control behave more like its Silverlight cousin (which has always had optional inertia).

You don’t need to do anything to use the new version – any requests to the v7 library will automatically retrieve the latest version, as follows:

[php]<script src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0" type="text/javascript"><!–mce:0–></script>[/php]

Of course, you might not want to use the new inertia effect. A quick dig around the code reveals that there is now a useInertia boolean property that can be passed in the mapOptions of the map constructor. To disable the inertia effect, create your map as follows:

map = new Microsoft.Maps.Map(
  document.getElementById("divMap"),
  {
    credentials: "ENTER YOUR KEY",
    center: new Microsoft.Maps.Location(54, -2),
    zoom: 4,
    mapTypeId: Microsoft.Maps.MapTypeId.road,
    useInertia: false
  }
);

You can also change the intensity of the inertial effect by setting the inertialIntensity property. If you want to make yourself dizzy, try the following and then give the map a give flick!

map = new Microsoft.Maps.Map(
  document.getElementById("divMap"),
  {
    credentials: "ENTER YOUR KEY",
    center: new Microsoft.Maps.Location(54, -2),
    zoom: 4,
    mapTypeId: Microsoft.Maps.MapTypeId.road,
    useInertia: true,
    inertiaIntensity: 1
  }
);

It’s almost impossible to make a side-by-side comparison of any other changes that occur between versions – the source code of the control is obfuscated, causing functions and parameters to be renamed with random letters between versions, so z = new function(cB, a) might be exactly the same as A = new function(h, t), but without comparing line-by-line you can’t be certain.

However, a quick examination of the new library does reveal some other interesting things to note:

  • New touch events: “touchstart“, “touchmove“, “touchend“, and “touchcancel
  • New classes: Microsoft.Maps.Streetside and Microsoft.Maps.VenueMaps

Of course, you can’t necessarily infer too much based only on the name of a class in the library but, even if these features aren’t exposed yet, it’s interesting to see what might be coming just round the corner…

Google Maps: A new angle on the world with 45° imagery

I’m a window seat person. If given the choice on a plane, I will always take the window seat, and not just so other passengers need not climb over me while I sleep. It’s also because I love the views during take off and landing. Whether it’s flying out over Sydney Harbour, or coming in to land over the Houses of Parliament in London, the view from a plane is a unique perspective on the world below.
Starting today you can bring that perspective to your Maps API applications with the launch of 45° imagery in select cities around the world. 45° imagery offers a superior perspective of city skylines than an overhead view. Tall buildings stand out from those around them, and iconic landmarks such as St. Mark’s Square in Venice are instantly recognisable. In addition you can rotate the map to look at buildings from all four sides:

You can track the cities where 45° imagery is currently available on this map. When 45° imagery is available a submenu option is added to the Maps API Satellite button. Right now the overhead imagery remains the default view for these areas. However in three weeks time this will change to match Google Maps, and the 45° imagery will become the default Satellite view where available.