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.
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;
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
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).