cmv / cmv-wab-widgets

Examples of using widgets from the ESRI WebApp Builder in CMV
https://cmv.github.io/cmv-wab-widgets/demo.html?config=wab
MIT License
9 stars 19 forks source link

Errors loading custom basemaps when integrating a WAB widget #15

Closed JhopStl closed 7 years ago

JhopStl commented 7 years ago

When adding the WAB widgets and their dependencies (_WABMixin in the controller), I get the following errors upon loading a custom basemap:

Basemap.js:4 esri.dijit.Basemap: unable to find the 'layers' property in parameters BasemapLayer.js:4 esri.dijit.BasemapLayer: unable to find the 'url' or 'type' property in parameters

I was not able to replicate this issue when loading AGOL basemaps. Also, it's worth noting that the basemap will not load at all in IE when using the same custom basemaps (still loads fine in Chrome, Firefox and Edge). The errors are generated after basemap creation takes place in the config (i.e. wab-measure.js) file.

Any ideas on what could be causing the issue? I've made the test site public: http://map.sccmo.org/Main/cmv_wab/demo.html but I can attach code if needed.

Besides that, the WAB widgets are working great CMV!

Thanks,

Jesse

JhopStl commented 7 years ago

Note: Reverting back to WAB versions 2.3 or 2.2 allows IE to load the basemap properly, however the aforementioned errors still persist.

tmcgee commented 7 years ago

@JhopStl i am using custom basemaps anf WAB version 2.4 without issue. Not sure what the issue is here. I'll try to debug your public app when at a desktop. Thanks for providing that.

JhopStl commented 7 years ago

@tmcgee I appreciate it. With that, I've probably just configured something incorrectly...I spent quite awhile looking at it, and I plan on spending even more time when I'm free.

tmcgee commented 7 years ago

@JhopStl Since you are using ESRI Map Services, did you try using basemap and baseMapLayers instead of layers? Here's an example for one of your custom basemaps:

aerial2015: {
    title: '2015 Aerial',
    basemap: {
        baseMapLayers: [
            {
                url: 'http://10.10.143.115/scc_gis/rest/services/appservices/JS_ortho2015/MapServer'             
        }
        ]           
    }
},

NOTE: I cannot test using the public application you provided since the i.p. address 10.10.143.115 is not accessible outside your network. I did test using these basemaps in the cmv demo.

JhopStl commented 7 years ago

@tmcgee Here is the working public URL: http://map.sccmo.org/Main/gis_dev/ I tried your suggestion, and it worked.

Viewer.js 1

Thanks!

cmccullough2 commented 7 years ago

Can you use Google Terrain as the main basemap? googleTerrain: { title: 'Google Terrain', basemap: new Basemap({ id: 'googleTerrain', layers: [new BasemapLayer({ url: "https://mt${subDomain}.google.com/vt/lyrs=t,r&hl=en&gl=en&x=${col}&y=${row}&z=${level}&s=png", copyright: "Google, 2015", id: "googleTerrain", subDomains: ["0", "1", "2", "3"], type:"WebTiledLayer" }) ] }) }