wrapAround180 map property with WAB

243
3
06-23-2020 02:46 AM
GeoGarage-vmbp-
New Contributor II

I'm developing with JS 2D API 3.24 in WAB 2.8, in the framework of AGS 10.6.1.

I need a map with the property wrapAround180 set to true. This is not a property configurable in WAB. I'm trying to configure it writting the property in config.json, in entry "map", sub entry "mapOptions", below "lods", with something like this:

:

"map": {

"3D": false,

...

},

"itemId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",

"mapOptions": {

   "lods": [

         {},

          ...

        {

            "level": 13,

            "scale": 1000,

            "resolution": 0.00000237

         }

   ],

   "wrapAround180": true,

   "extent": { ...

Nevertheless, when app is launched, the map has this property in false.

If in the same line of the config.json file I put the property "zoom": 4,deleting "wraparound180" property, then the map starts in zoom = 4. In others words: it must work.

The file config-readme.txt confirm that in "mapOptions" entry of config.json we can put same options as the map API options.

Debbuging, I can see that this property is true until _show2DWebMap method in MapManager.js file, in jimu.js folder of the App. In this method, map.wrapAround180 is false. I have chenged this value programatically and runs ok... until we do zoom, when map becomes invisible.

Some suggestion?

Thanks in advance.

The universe is a hostile place
0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

VM BP,

   The maps options are set in the MapManager look in the _show2DWebMap function and find the var mapOptions = .... Then add a line like

mapOptions.wrapAround180 = true;

0 Kudos
GeoGarage-vmbp-
New Contributor II

Robert Scheitlin, GISP‌,

thank you very much for your answer. I cannot get it works. My application is made with WAB 2.8 Developer edition, and I have edited with Sublime the function _show2DWebMap in MapManager.js in:

var mapOptions = this.processMapOptions(... ;
mapOptions.isZoomSlider = false;
mapOptions.wrapAround180 = true; //this is the line that I have added and doesn't work

Is anything that am I doing wrong or is a bug?

Thank you very much

The universe is a hostile place
0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Victor,

   I just tested WAB 2.8 and by default (no config or code changes) the map is already enabled to wrap 180 (when using an esri basemap).

0 Kudos