AnsweredAssumed Answered

Error: smartMapping.createClassedColorRenderer: unable to find suitable style scheme.

Question asked by akshay.5.loya on Feb 5, 2018
Latest reply on Feb 8, 2018 by akshay.5.loya
Hi,
I don't know what wrong I'm doing here. I'm trying to implement smart mapping renderer on web app builder.
I have just copy pasted the code from sample itself still it is giving me an error.
Error: smartMapping.createClassedColorRenderer: unable to find suitable style scheme.
Can someone please help me with the issue.
   
define([
'dojo/_base/declare',
'jimu/BaseWidget',


"dojo/query",
"dojo/_base/lang",
'dojo/_base/array',
"dojox/form/RangeSlider",
"dijit/form/VerticalRule",
"dijit/form/VerticalSlider",
"dijit/form/VerticalRuleLabels",
"dojo/dom-construct",
"dojo/dom",
"dojo/on",
"dojox/widget/ColorPicker",
"dijit/form/DropDownButton",
"dijit/ColorPalette",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",


"esri/renderers/SimpleRenderer",
"esri/symbols/SimpleMarkerSymbol",
"esri/Color",
"esri/renderers/DotDensityRenderer",
"esri/renderers/ScaleDependentRenderer",
"esri/dijit/Legend",
"esri/renderers/smartMapping",
"esri/dijit/ClassedColorSlider",
"esri/layers/FeatureLayer",

],
function (
declare,
BaseWidget,


query,
lang,
array,
RangeSlider,
VerticalRule,
VerticalSlider,
VerticalRuleLabels,
domConstruct,
dom,
on,
ColorPicker,
DropDownButton,
ColorPalette,
BorderContainer,
ContentPane,


SimpleRenderer,
SimpleMarkerSymbol,
Color,
DotDensityRenderer,
ScaleDependentRenderer,
Legend,
smartMapping,
ClassedColorSlider,
FeatureLayer
) {
.................



var outFields = ["POP2007", "POP07_SQMI", "WHITE", "BLACK", "AMERI_ES", "ASIAN", "HAWN_PI", "OTHER", "MULT_RACE", "HISPANIC", "STATE_NAME", "NAME"];
var layer1 = new FeatureLayer("//sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/2", {
"id": "Washington",
"mode": FeatureLayer.MODE_SNAPSHOT,
"outFields": outFields,
"opacity": 0.8
});


//only working with Washington state
layer1.setDefinitionExpression("STATE_NAME='Washington'");
this.map.addLayer(layer1);


layer1.on("load", lang.hitch(this, function () {
smartMapping.createClassedColorRenderer({
layer: layer1,
field: "POP2007",
basemap: this.map.getBasemap(),
classificationMethod: "quantile"
}).then(function (response) {
layer1.setRenderer(response.renderer);
layer1.redraw();
// createLegend(this.map, layer1, field);
});
}));

Outcomes