Skip to content

Instantly share code, notes, and snippets.

@RalucaNicola
Last active October 18, 2019 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RalucaNicola/ce62c54433403636ce4a269e32f6cf3b to your computer and use it in GitHub Desktop.
Save RalucaNicola/ce62c54433403636ce4a269e32f6cf3b to your computer and use it in GitHub Desktop.
unique value renderer
const renderer = new UniqueValueRenderer({
valueExpression: "$feature.pred_party",
defaultSymbol: createSymbol("lightgray"),
uniqueValueInfos: partyCodes.map(party => {
return {
value: party.field,
symbol: createSymbol(party.color)
}
})
});
function createSymbol(color: string) {
return new SimpleMarkerSymbol({
color: color,
outline: {
width: 0
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment