AnsweredAssumed Answered

Red line with black outline in JavaScript API

Question asked by piterpaulppp on Oct 20, 2016
Latest reply on Oct 23, 2016 by rscheitlin

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();

...
};

Attachments

Outcomes