Select to view content in your preferred language

SimplelineSymbol with line border

04-05-2019 02:27 PM
New Contributor II

I have created one query layer map by consuming featurelayerserver service URL in JavaScript API 4.10. Where I have some poly lines and I have added the graphics to display the lines in green color.And now I need to give a border in black color to that yellow line. Can anyone help me by giving the direction how to achieve that in JavaScript API 4.10 query graphics layer. My sample code is as below -

        queryTask.execute(querygreen).then(function(result) {
          result.features.forEach(function(item) {
            var green = new Graphic({
              geometry: item.geometry,
              attributes: item.attributes,
              symbol: {
                type: "simple-line",
                color: "#417505",
                width: 2

          // Zoom to the features

Can anyone please help me ..

0 Kudos
2 Replies
Occasional Contributor II

Perhaps Outline is what you're looking for?

Paste a mock up of what you want to achieve.

0 Kudos
MVP Regular Contributor

In version 3.X of the API you could specify the outline colour seperately from the inner colour, but I the 4.X LineSymbol does not have that property.  You might need to add an additional black line graphic for each feature with an bigger width before adding the yellow line graphic.

0 Kudos