Feature symbol not displaying correctly

677
2
03-03-2020 08:58 PM
YashvitNaik
New Contributor III

Hi,
I am using ArcGIS Javascript API version 3.31 for my desktop web application, we have a Feature Service layer of type esriGeometryPolyline.
The issue is that the arrow symbol from the layer, do not render properly when the layer is added to the map, instead thick lines display on the map.


The image below displays the rendering of the layer having an arrow symbol on the map.
Layer not rendering arrow on map
                                                                       (Fig1: NotWorkingLayer.png)


however, we have another feature service layer, having an arrow symbol, which works perfectly fine with the map.

Layer rendering arrow on map
                                                                        (Fig2: WorkingLayer.png)

code to add feature layer on map:
var serviceUrl='URL to the service'
var featureLayer = new this.esri.FeatureLayer(serviceUrl, {
url: serviceUrl
mode: this.esri.FeatureLayer.MODE_SNAPSHOT,
outFields: ["*"]
});
map.addLayers([featureLayer ]);

Please find attached the layer samples.

Thanks.

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Yashvit,

   The issue you are encountering is that when a layer is added as a FeatureLayer in the map it is using clientside rendering and there is no support for Cartographic line symbols like lines with arrows indicating direction on the clientside. Most likely the other layer that you are showing in your image is being added to the map as a ArcGISDynamicMapserviceLayer and thus the rendering for that layer is done on the server which does support cartographic line symbols.

HenryKo2
New Contributor III

One workaround to render cartographic line symbols in feature services is to use CIMSymbols. I had to symbolise polyline with 2 parallel black lines (like railway). I ended up using CIMLineSymbol to solve my problem.

0 Kudos