Hi,
We need to draw roads as a red line with black outline (or stroke) (see attached) with ESRI JavaScript API.
Something like that (example from leaflet - Leaflet.MapboxVectorTile.js):
drawLineString = function(....){
....
var ctx2d = ctx.canvas.getContext('2d');
ctx2d.strokeStyle = style.color;
ctx2d.lineWidth = style.size;
ctx2d.beginPath();
ctx2d.stroke();
if (style.outlineWidth && style.outlineColor) {
ctx2d.lineWidth = style.outlineWidth;
ctx2d.strokeStyle = style.outlineColor;
ctx2d.stroke();
...
};
Solved! Go to Solution.
It's a different API with different capabilities.
Piterson,
There is nothing in the JS for setting a stroke on a line. The best you can do it add the line graphic twice using different SimpleLineSymbols with different widths and colors.
Thanks Robert,
It means we have no access to the library that draw the geometry?
Piterson,
No, you just dont have the ability to define a line symbol that has a separate outline color.
Why it is possible for Leaflet.MapboxVectorTile.js?
It's a different API with different capabilities.