0

I am upgrading from Bing Maps V7 to V8 and rotating the map from JS doesn't work anymore. I have been trying with this piece of code:

map.setView( { heading:90 } );

This works if I change the source URL for the map library to V7. And I see that the "setView" function and the "heading" option still exist in V8.

Here's an article about how to do it in V7: https://alastaira.wordpress.com/2012/03/28/rotating-bing-maps/

rbrundritt
  • 16,570
  • 2
  • 21
  • 46
Costin_T
  • 786
  • 1
  • 8
  • 27

2 Answers2

1

Bing Maps V8 currently doesn't have Birdseye. A new birdseye experience is being introduced to V8 within the next few months. This new experience has a lot of new imagery which uses a different format from the old birdseye experience. Given that the imagery that is in V7 is very old and is a major point of DSAT, it was decided to hold off on adding birdseye to V8 until the next experience and data is available.

rbrundritt
  • 16,570
  • 2
  • 21
  • 46
  • Thanks, but I figured this out in another post - http://stackoverflow.com/questions/38611054/no-more-birds-eye-view-in-the-bing-maps-v8-api/38614006 – Costin_T Sep 28 '16 at 08:17
  • Update: Birdseye was added to Bing Maps V8 at the beginning of April in the experimental branch. It is now in the main release branch. A button is not in the map type dropdown at this time as the team is waiting until more of the new imagery is processed and available in the control. – rbrundritt Jun 27 '17 at 00:59
1

I did some more research and two undocumented things have changed.

  1. map.setView() does not respond to a full options object anymore. Example:

    var options = this.map.getOptions();

    options.heading = 90;

    map.setView(options);

It now needs the heading and other changed fields manually specified to reflect any changes.

map.setView({heading: 90});
  1. map.setView({heading: xx}) no longer accepts negative values as valid so you must manually submit heading values for any clockwise rotations so that it corresponds to the positive heading value.
    Thus, map.setView({heading: -90}) was previously smart enough to know that is equivalent to map.setView({heading: 270}), but now must be submitted to the API as a positive value.

Similar to the first example, I have some legacy code for resetting the map back to original lat/lon and heading that now needs a second setView() call in order to update.

var options = this.map.getOptions();
options.zoom = this.initialZoom;
options.center = new Microsoft.Maps.Location(this.lat, this.lon);
options.heading = this.heading = 0;
this.map.setView(options);
this.map.setView({heading: this.heading});

Must call setView another time so that the new heading is actually applied.

lyimnida
  • 11
  • 3