Skip to content

Instantly share code, notes, and snippets.

@cecilemuller
Created March 4, 2012 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cecilemuller/1973187 to your computer and use it in GitHub Desktop.
Save cecilemuller/1973187 to your computer and use it in GitHub Desktop.
Get the current map style, even in automatic mode, in Bing Maps AJAX 7.0
var map = new Microsoft.Maps.Map(
document.getElementById("map"),
{
credentials: "YOUR-BING-KEY",
mapTypeId: Microsoft.Maps.MapTypeId.auto
}
);
Microsoft.Maps.Events.addHandler(map, "imagerychanged",
function(){
var style = this.target.getImageryId();
//
// "style" contains the type of imagery being displayed
//
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment