Can anyone provide different graphic colors for simple line symbol and symbol fill symbol
on simple line symbol and simple fill symbol you can change the color by setting the Color parameter
require([
"esri/symbols/SimpleLineSymbol", "esri/Color", ...
], function(SimpleLineSymbol, Color, ... ) {
var sls = new SimpleLineSymbol(
SimpleLineSymbol.STYLE_DASH,
new Color([255,0,0]),
3
);
...
});
see the javascript help
SimpleLineSymbol | API Reference | ArcGIS API for JavaScript
Also the same for fill symbol
require([
"esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol", "esri/Color", ...
], function(SimpleFillSymbol, SimpleLineSymbol, Color, ... ) {
var sfs = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID,
new SimpleLineSymbol(SimpleLineSymbol.STYLE_DASHDOT,
new Color([255,0,0]), 2),new Color([255,255,0,0.25])
);
...
});
The fill is always black for me. The color property does not appear to change the color, i.e. STYLE_VERTICAL. Always black.
Is this a known issue? Thanks!
Jerry,
This has been a long standing bug/limitation and can been seen and tested in the Symbol playground
Hello Robert,
The link wich you gave was excellent.
Thank u very much
Interestingly, the colors you set for the diagonal or all other Fillings are displayed correctly when you print
the graphic. This is how we handle it. You can set the color, but only in the printout it will be visible.
It's been some time since I tried this, but I believe another option if your data is being accessed via an ArcGIS Server Map Service (10.1+) is to switch to an ArcGISDynamicMapServiceLayer and use the LayerDrawingOptions so the symbol is rendered on the server.
Hey John!
But the main Problem stays when you want to draw your own Graphic.
In this Point the Api says that the color only applies, when you have a solid filling.
The other Fillings ignore the colorsetting on screen like in the "Playground"-Example above.