Hi, how can I set highlight symbology for a feature layer in the LocalLayer widget?
Thanks.
Naty
Solved! Go to Solution.
Naty,
Just add this line 39 to the below code block in the Widget.js for the Local Layer Widget
}else if (layer.type.toUpperCase() === 'FEATURE') { var _popupTemplate; if (layer.popup){ _popupTemplate = new PopupTemplate(layer.popup); lOptions.infoTemplate = _popupTemplate; } if(layer.hasOwnProperty('mode')){ var lmode; if(layer.mode === 'ondemand'){ lmode = 1; }else if(layer.mode === 'snapshot'){ lmode = 0; }else if(layer.mode === 'selection'){ lmode = 2; } lOptions.mode = lmode; } lOptions.outFields = ['*']; if(layer.hasOwnProperty('autorefresh')){ lOptions.refreshInterval = layer.autorefresh; } if(layer.hasOwnProperty('showLabels')){ lOptions.showLabels = true; } lLayer = new FeatureLayer(layer.url, lOptions); if(layer.name){ lLayer._titleForLegend = layer.name; lLayer.title = layer.name; lLayer.noservicename = true; } if(layer.hasOwnProperty('definitionQuery')){ lLayer.setDefinitionExpression(layer.definitionQuery); } if(layer.hasOwnProperty('customRenderer')){ if (layer.customRenderer != ""){ lLayer.setRenderer(new esri.renderer.SimpleRenderer(jsonUtils.fromJson(JSON.parse(layer.customRenderer)))) } } lLayer.setSelectionSymbol(new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, null, new Color([109,207,246,0.6])));
Naty,
Just add this line 39 to the below code block in the Widget.js for the Local Layer Widget
}else if (layer.type.toUpperCase() === 'FEATURE') { var _popupTemplate; if (layer.popup){ _popupTemplate = new PopupTemplate(layer.popup); lOptions.infoTemplate = _popupTemplate; } if(layer.hasOwnProperty('mode')){ var lmode; if(layer.mode === 'ondemand'){ lmode = 1; }else if(layer.mode === 'snapshot'){ lmode = 0; }else if(layer.mode === 'selection'){ lmode = 2; } lOptions.mode = lmode; } lOptions.outFields = ['*']; if(layer.hasOwnProperty('autorefresh')){ lOptions.refreshInterval = layer.autorefresh; } if(layer.hasOwnProperty('showLabels')){ lOptions.showLabels = true; } lLayer = new FeatureLayer(layer.url, lOptions); if(layer.name){ lLayer._titleForLegend = layer.name; lLayer.title = layer.name; lLayer.noservicename = true; } if(layer.hasOwnProperty('definitionQuery')){ lLayer.setDefinitionExpression(layer.definitionQuery); } if(layer.hasOwnProperty('customRenderer')){ if (layer.customRenderer != ""){ lLayer.setRenderer(new esri.renderer.SimpleRenderer(jsonUtils.fromJson(JSON.parse(layer.customRenderer)))) } } lLayer.setSelectionSymbol(new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, null, new Color([109,207,246,0.6])));
Thanks