I know this question's scope is bigger than some lines of code, but maybe somebody did this already.
We have like 40 webmap's and i'm trying to add the editable feature layer with the edit widget, because it's just an error reporting layer, so the user doesn't really need to see it all the time. I configured the edit widget with it's config, i see the printed parameters, if i open the widget.
Any idea what i missed?
This is how i load it:
addErrorReportLyr: function(){
var featureLayer = new FeatureLayer("https://hostname.local/arcgis/rest/services/errorReports/FeatureServer/0",
{id:"errorReports"});
this.map.addLayer(featureLayer);
console.log('addlayer');
featureLayer.on('load', lang.hitch(this, function() {
LayerInfos.getInstance(this.map, this.map.itemInfo).then(lang.hitch(this, function(layerInfos) {
var featureLayerInfo = layerInfos.getLayerInfoById(featureLayer.id);
featureLayerInfo.title = '';
featureLayerInfo.loadInfoTemplate().then(lang.hitch(this, function() {
console.log(featureLayerInfo);
}));
}));
}));
},
And how i call it(i know it's not nice, but has to be first i think):
_prepareCreating: function() {
// beginEditingByFeatures can be called from outside,
// so _init must be called before userDef resolved.
this.addErrorReportLyr();
this._init();
this.loading.show();
- allowCreate: true //This is my print from _getLayerInfosConfig
- allowDelete: true
- disableGeometryUpdate: false
- featureLayer: {id: "errorReports"}//my current map's print btw: graphicsLayerIds: (2) ["graphicsLayer1", "errorReports"]
- fieldInfos: (5) [{…}, {…}, {…}, {…}, {…}]
- __proto__: Object
- length: 1
- __proto__: Array(0)
_getLayerInfosInConfig: function() {
...
else if(this._configEditor.layerInfos.length > 0) {
// configured and has been checked.
//layerInfos = this._getDefaultLayerInfos();
layerInfos = this._converConfiguredLayerInfos(this._configEditor.layerInfos);
console.log("3",layerInfos);