Hi,
I am trying to create an instance of a WebStyleSymbol and then clone it to vary the height. However, I can't seem to find a way of doing so. When I try to autocast a symbol as WebStyleSymbol and then call it with e.g. fetchSymbol() or clone(), I get the "webStyleSymbol.clone is not a function" error. This leads me to believe that the casting itself somehow went wrong, even though the type is specified as "web-style".
I am not very proficient in Javascript or the ArcGIS API, so this might as well be some easy to avoid mistake Any help is appreciated. Find attached the minimum example to reproduce the error.
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Minimum working example</title>
<style>
html, body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.22/esri/themes/light/main.css">
<script src="https://js.arcgis.com/4.22/"></script>
<script>
require([
"esri/config",
"esri/symbols/WebStyleSymbol"
],(esriConfig, WebStyleSymbol)=> {
//autocast new symbol
let webStyleSymbol = {
type: "web-style",
styleName: "EsriInfrastructureStyle",
name: "Wind_Turbine"
};
console.log(webStyleSymbol.type); //check the type --> output "web-style"
webStyleSymbol.clone(); //clone the symbol --> this throws an error
console.log(webStyleSymbol.type); //check again
})
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>