Select to view content in your preferred language

How to stop Map from rotating using JS API

1129
1
Jump to solution
05-31-2013 01:20 AM
ShashankA
Emerging Contributor
Hi

I have simple map. I'm adding a layer of type 'ArcGISTiledMapServiceLayer' and displaying 'https://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer' map.

No when I pan the map to Left or Right side a new map starts to appear on the screen as if they are endless of maps on the screen which come up as I keep on pan the map to Right or Left sides.

I don't want my map to display another map on the screen. Please refer to the Screenshot of what I mean.

In the screen shot you can see that when I pan right bringing Australia in to the middle of my screen I see SouthAmercica slowly coming in to the screen from right hand side of the map.

I want this behaviour to be stopped. Is their any way to stop this behaviour of the map?

Update:
Currently I'm using 3.4 version of Js API. When I user earlier versions of the Js API like 2.8 I get the functionality what I want i.e., new map does not creeps out from other side of the map when user panns the map to one side of the map.
Thanks in advance.
0 Kudos
1 Solution

Accepted Solutions
MarkHoover
Frequent Contributor
This is a property you can configure when you create your map object.  It's an option (the second, optional parameter for a map object).  From the documentation:

<Boolean> wrapAround180 When true, supports continuous pan across the dateline. Wraparound is supported in the following cases:

    Map spatial reference is WGS84 or Web Mercator
    The tiling scheme is either the pre-9.3 ArcGIS Online (4326) tiling scheme or ArcGIS/Google Maps/ Bing tiling scheme.
    Dynamic services must be version 10 or greater.

At version 3.1 the default value is true. For versions earlier than 3.1 the default value is false.

http://developers.arcgis.com/en/javascript/jsapi/map.html#map1

View solution in original post

0 Kudos
1 Reply
MarkHoover
Frequent Contributor
This is a property you can configure when you create your map object.  It's an option (the second, optional parameter for a map object).  From the documentation:

<Boolean> wrapAround180 When true, supports continuous pan across the dateline. Wraparound is supported in the following cases:

    Map spatial reference is WGS84 or Web Mercator
    The tiling scheme is either the pre-9.3 ArcGIS Online (4326) tiling scheme or ArcGIS/Google Maps/ Bing tiling scheme.
    Dynamic services must be version 10 or greater.

At version 3.1 the default value is true. For versions earlier than 3.1 the default value is false.

http://developers.arcgis.com/en/javascript/jsapi/map.html#map1
0 Kudos