How to stop repeating Bing Map V8 tiles

Bala Krishna Guggilla 21 Reputation points
2022-12-29T08:52:07.963+00:00

I have displayed a Bing Map v8 on my webpage. But, when i am panning the map, map is coming again and again from left to right or right to left. I want to stop this. I want only one map. how to achieve this functionality?.
I'm Using Microsoft.Maps.SpatialMath.getGeodesicPath to draw path between two points. Due to map repeating, showing some part on left side and other part in right side.

Thanks in advance.

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
587 questions
Windows Maps
Windows Maps
A Microsoft app that provides voice navigation and turn-by-turn driving, transit, and walking directions.
245 questions
{count} votes

Accepted answer
  1. rbrundritt 15,231 Reputation points Microsoft Employee
    2022-12-30T02:40:44.233+00:00

    What you are seeing is called world wrap. It's kind of like being able to spin the globe. The Bing Maps V8 SDK doesn't have a specific option to disable this feature, however, you can set the maxBounds option of the map to the limits of a single "world" and it will prevent the ability to pan the map infinitely left and right, however it likely won't change how things are rendered on the map. Here is an example of setting this option when loading the map:

       var map = new Microsoft.Maps.Map(document.getElementById('myMap'), {	  
       	maxBounds: new Microsoft.Maps.LocationRect(new Microsoft.Maps.Location(0,0), 360, 180)  
       });  
    
    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Clemens Schotte 356 Reputation points Microsoft Employee
    2022-12-29T14:06:25.93+00:00

    You can set the maxBounds option to set the bounding area that restricts the map view.

    0 comments No comments