Error in using LineSymbolMarker

612
4
Jump to solution
02-04-2021 09:15 AM
rajeshesri01
New Contributor II

I need to show arrow in poly line. So i tired https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbolMarker.html#dec...

I try using LineSymbolMarker, try to define symbol as 

var simpleLineSymbol = {
type: "line-marker",
color: "orange", // orange
width: 1.5,
marker: { // autocasts from LineSymbolMarker
style: "arrow",
color: "blue",
placement: "begin"
}
};

 

But it showing plane black line instead of line with arrow and below error also coming:-

 

[esri.core.Accessor] Accessor#set Invalid property value, value needs to be one of 'esri.symbols.SimpleFillSymbol', 'esri.symbols.PictureFillSymbol', 'esri.symbols.PictureMarkerSymbol', 'esri.symbols.SimpleLineSymbol', 'esri.symbols.SimpleMarkerSymbol', 'esri.symbols.TextSymbol', 'esri.symbols.LabelSymbol3D', 'esri.symbols.LineSymbol3D', 'esri.symbols.MeshSymbol3D', 'esri.symbols.PointSymbol3D', 'esri.symbols.PolygonSymbol3D', 'esri.symbols.WebStyleSymbol', 'esri.symbols.CIMSymbol', or a plain object that can autocast (having .type = 'simple-fill', 'picture-fill', 'picture-marker', 'simple-line', 'simple-marker', 'text', 'label-3d', 'line-3d', 'mesh-3d', 'point-3d', 'polygon-3d', 'web-style', 'cim')

 

Please suggest what to do ?

0 Kudos
2 Solutions

Accepted Solutions
AnneFitz
Esri Contributor

Hello,

The type should be "simple-line" instead of "line-marker". Hope this helps!

View solution in original post

rajeshesri01
New Contributor II

Thanks it worked. But in manual it mentioned For LineSymbolMarker the type is always "line-marker". Might be some misinformation. Thanks for you help.

View solution in original post

0 Kudos
4 Replies
rajeshesri01
New Contributor II
0 Kudos
AnneFitz
Esri Contributor

Hello,

The type should be "simple-line" instead of "line-marker". Hope this helps!

rajeshesri01
New Contributor II

Thanks it worked. But in manual it mentioned For LineSymbolMarker the type is always "line-marker". Might be some misinformation. Thanks for you help.

0 Kudos
AnneFitz
Esri Contributor

No - that's true, the LineSymbolMarker is just being autocast on the SimpleLineSymbol. 

var simpleLineSymbol = {
  type: "simple-line",
  color: "orange", // orange
  width: 1.5, 
  marker: { // autocasts from LineSymbolMarker
    type: "line-marker",
    style: "arrow",
    color: "blue",
    placement: "begin"
  }
};

You could add the type: "line-marker" on the marker property - but you don't have to since it is autocast. Hope this helps clear things up!