updateLineType: function (value, graphic) { switch (graphic._type) { case 'polyline': graphic.symbol.setStyle(value); break; case 'polygon': //what is wrong with setting polygon outline style????? graphic.symbol.outline.setStyle(value); break; } graphic.getLayer().refresh(); }, updateLineWidth: function (value, graphic) { switch (graphic._type) { case 'polyline': graphic.symbol.setWidth(value); break; case 'polygon': //what is wrong with setting polygon outline width????? graphic.symbol.outline.setWidth(value); break; } graphic.getLayer().refresh(); },
Solved! Go to Solution.
Polygon outline setStyle() and setWidth() are not updating the graphic in the map but the object is updating. These are the only two that aren't working for all symbol types and settings.
A fiddle to demonstrate.
The functions in question:updateLineType: function (value, graphic) { switch (graphic._type) { case 'polyline': graphic.symbol.setStyle(value); break; case 'polygon': //what is wrong with setting polygon outline style????? graphic.symbol.outline.setStyle(value); break; } graphic.getLayer().refresh(); }, updateLineWidth: function (value, graphic) { switch (graphic._type) { case 'polyline': graphic.symbol.setWidth(value); break; case 'polygon': //what is wrong with setting polygon outline width????? graphic.symbol.outline.setWidth(value); break; } graphic.getLayer().refresh(); },
var symbol = polygon.symbol; symbol.outline.setStyle(SLS.STYLE_DASH); polygon.setSymbol(symbol);
Polygon outline setStyle() and setWidth() are not updating the graphic in the map but the object is updating. These are the only two that aren't working for all symbol types and settings.
A fiddle to demonstrate.
The functions in question:updateLineType: function (value, graphic) { switch (graphic._type) { case 'polyline': graphic.symbol.setStyle(value); break; case 'polygon': //what is wrong with setting polygon outline style????? graphic.symbol.outline.setStyle(value); break; } graphic.getLayer().refresh(); }, updateLineWidth: function (value, graphic) { switch (graphic._type) { case 'polyline': graphic.symbol.setWidth(value); break; case 'polygon': //what is wrong with setting polygon outline width????? graphic.symbol.outline.setWidth(value); break; } graphic.getLayer().refresh(); },
var symbol = polygon.symbol; symbol.outline.setStyle(SLS.STYLE_DASH); polygon.setSymbol(symbol);
Thanks Roberto. That works.
It's just curious that all other symbol types and their respective set methods work in that manner but these two don't.