Has anyone been able to add extra levels of detail (LOD) in an application that was built in web app builder? I know I can add the extra levels using code but I'm not sure which file to add the code to.
Thanks,
Brandon
Solved! Go to Solution.
Brandon,
Due to the fact that WAB uses a web map from AGOL when creating the map object you would have to feed the MapManager.js _processMapOptions function from new code like:
_processMapOptions: function(mapOptions) { if (!mapOptions) { return; } var ret = lang.clone(mapOptions); if (ret.extent) { ret.extent = new Extent(ret.extent); } if (ret.infoWindow) { ret.infoWindow = new InfoWindow(ret.infoWindow, html.create('div', {}, this.mapDivId)); } //Start new code ret.lods = [ {"level" : 0, "resolution" : 0.010986328125, "scale" : 4617149.97766929}, {"level" : 1, "resolution" : 0.0054931640625, "scale" : 2308574.98883465}, {"level" : 2, "resolution" : 0.00274658203125, "scale" : 1154287.49441732}, {"level" : 3, "resolution" : 0.001373291015625, "scale" : 577143.747208662}, {"level" : 4, "resolution" : 0.0006866455078125, "scale" : 288571.873604331} ]; //end new code return ret; },
BTW you would have to specify ALL the original LODS as well as your additions.
Brandon,
Due to the fact that WAB uses a web map from AGOL when creating the map object you would have to feed the MapManager.js _processMapOptions function from new code like:
_processMapOptions: function(mapOptions) { if (!mapOptions) { return; } var ret = lang.clone(mapOptions); if (ret.extent) { ret.extent = new Extent(ret.extent); } if (ret.infoWindow) { ret.infoWindow = new InfoWindow(ret.infoWindow, html.create('div', {}, this.mapDivId)); } //Start new code ret.lods = [ {"level" : 0, "resolution" : 0.010986328125, "scale" : 4617149.97766929}, {"level" : 1, "resolution" : 0.0054931640625, "scale" : 2308574.98883465}, {"level" : 2, "resolution" : 0.00274658203125, "scale" : 1154287.49441732}, {"level" : 3, "resolution" : 0.001373291015625, "scale" : 577143.747208662}, {"level" : 4, "resolution" : 0.0006866455078125, "scale" : 288571.873604331} ]; //end new code return ret; },
BTW you would have to specify ALL the original LODS as well as your additions.
Hi Robert,
Thanks for the reply! I will give this a try and let you know how it goes. Is the MapManager.js_processMapOptions function usually in the same file? Also, your response brings up another question we've had regarding WAB. We've been using it to jumpstart our application building as well as for our users who aren't as skilled in pure javascript. But for one of our main applications we'd like to run completely off of our ArcGIS Server and aren't sure how we would use operational layers like we have in the past for flex applications. Can you give me any guidance on this?
Best,
Brandon
Brandon,
The closest thing (currently) to making WAB more like Flex Viewer (as far as operational and basemap layer from your own server) is to use the Local Layer Widget. LocalLayerWidget and AccessifizrWidget
This widget still does not get past the need to use a AGOL Web Map as the starting point (i.e. setting the LODs and spatial reference). Unless esri changes something the need to use a AGOL web map is going to be a requirement.
Thanks Robert,
I like the looks of the LocalLayerWidget. Slightly disappointing that WAB doesn't support operational layers in the same way but not entirely surprising. Our reasoning for wanting to have the operational layers is to not have to purchase additional named user accounts. Is there another way to accomplish this without going the whole way to a completely custom Javascript app? We have our ArcGIS Server tied into AGOL using ADFS. Thanks in advance.
Best,
Brandon
Brandon,
Sure you just publish a web map to your AGOL account that has the spatial reference and LODs that your WAB app will need and then you use the Local Layer widget to overwrite every thing, operational Layers and Basemap, just like Flex Viewer. The only thing the web map will be used for is LODs and Spatial Reference if you use the local Layer widget. The local layer widget allows you to use your own ArcGIS Server services.
Hi Robert,
I was finally able to test your code and it worked like a charm. Since we started talking about this it looks like a new version of web app builder developer edition lets you add extra zoom scales from the user interface. But it must be doing it slightly differently then you had suggested because when I examine the resulting _processMapOptions section in the MapManager.js file I don't see any extra code. Do you, or anyone reading, know how the new version of web app builder developer handles the extra scales?
Thanks,
Brandon
While looking to do this I ended up on this thread, in the spirit of more information for the next person...
In the the latest web app builder at the time of this post I added to my config.json the code below which gets dealt with within the api "somewhere". lods is in MapOptions at the same level as the extent.
"mapOptions": { "extent": { "xmin": -1, "ymin": -1, "xmax": -1, "ymax": 1, "spatialReference": { "wkid": 102100 } }, "lods" : [ { "level" : 0, "resolution" : 156543.033928, "scale" : 591657527.591555 }, { "level" : 1, "resolution" : 78271.5169639999, "scale" : 295828763.795777 }, { "level" : 2, "resolution" : 39135.7584820001, "scale" : 147914381.897889 }, { "level" : 3, "resolution" : 19567.8792409999, "scale" : 73957190.948944 }, { "level" : 4, "resolution" : 9783.93962049996, "scale" : 36978595.474472 }, { "level" : 5, "resolution" : 4891.96981024998, "scale" : 18489297.737236 }, { "level" : 6, "resolution" : 2445.98490512499, "scale" : 9244648.868618 }, { "level" : 7, "resolution" : 1222.99245256249, "scale" : 4622324.434309 }, { "level" : 8, "resolution" : 611.49622628138, "scale" : 2311162.217155 }, { "level" : 9, "resolution" : 305.748113140558, "scale" : 1155581.108577 }, { "level" : 10, "resolution" : 152.874056570411, "scale" : 577790.554289 }, { "level" : 11, "resolution" : 76.4370282850732, "scale" : 288895.277144 }, { "level" : 12, "resolution" : 38.2185141425366, "scale" : 144447.638572 }, { "level" : 13, "resolution" : 19.1092570712683, "scale" : 72223.819286 }, { "level" : 14, "resolution" : 9.55462853563415, "scale" : 36111.909643 }, { "level" : 15, "resolution" : 4.77731426794937, "scale" : 18055.954822 }, { "level" : 16, "resolution" : 2.38865713397468, "scale" : 9027.977411 }, { "level" : 17, "resolution" : 1.19432856685505, "scale" : 4513.988705 }, { "level" : 18, "resolution" : 0.597164283559817, "scale" : 2256.994353 }, { "level" : 19, "resolution" : 0.298582141647617, "scale" : 1128.497176 }, { "level" : 20, "resolution": 0.14929107082380833, "scale": 564.248588 }, { "level" : 21, "resolution": 0.074645535411904245, "scale": 282.124294 }, { "level" : 22, "resolution": 0.0373227677059521225, "scale": 141.062147 } ] },
Please forgive my daftness. Where is this file located? Thanks in advance!
Ed,
The config.json is in the root of the app
[wab install dir]\server\apps\[app num]\config.json