AnsweredAssumed Answered

[esri.layers.FeatureLayer] #load() Failed to load layer

Question asked by DanCathie on Dec 17, 2018
Latest reply on Dec 17, 2018 by rscheitlin

[esri.layers.FeatureLayer] #load() Failed to load layer

message: "Feature layer must be created with either a url or a source"

name: "feature-layer:missing-url-or-source"

I'm getting a bunch of these errors when trying to load my webmap. It's only on some of the layers as others load fine. Here is my code:

require([
    "esri/WebMap",
    "esri/views/MapView",
    "esri/widgets/Legend",
    "esri/widgets/LayerList",
    "dojo/domReady!"
], function(
    WebMap, MapView, Legend, LayerList
) {

    var webmap = new WebMap ({
        portalItem: {
            id: "myId1234567890"
        }
    });

    var view = new MapView({
        container: "viewDiv",
        map: webmap
    });

    view.when(function() {
        var layerList = new LayerList({
            view: view
        }, "layerDiv");
    });
});

Thanks

Outcomes