Bing Maps AJAX 7.0: get the current map style, even in automatic mode


/ Published in: JavaScript
Save to your folder(s)

**Important: this snipplet has moved to Github.**

- [Get the current map style, even in automatic mode, in Bing Maps AJAX 7.0](https://gist.github.com/1973187)


Copy this code and paste it in your HTML
  1. var map = new Microsoft.Maps.Map(
  2. document.getElementById("map"),
  3. {
  4. credentials: "YOUR-BING-KEY",
  5. mapTypeId: Microsoft.Maps.MapTypeId.auto
  6. }
  7. );
  8.  
  9. Microsoft.Maps.Events.addHandler(map, "imagerychanged", function(){
  10. var style = this.target.getImageryId();
  11. //
  12. // "style" contains the type of imagery being displayed
  13. //
  14. });

URL: http://www.wildpeaks.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.