Problem with the color of a feature layer

1416
5
09-25-2014 09:13 AM
BrunoAvard1
New Contributor II

Hi,

We have an application using the Arcgis API for JavaScript (version3.9)

and if seems that there is a problem with the display of feature layer compare to a dynamic layer.

I made available a layer for testing

test/Test_Protected_Areas (MapServer)

The issue is that the diagonal line are showing red in the service but they are displayed in black in the Arcgis API for JavaScript when using the feature layer. The display is fine if we use the dynamic layer. In our case we need to be able to access all layers of a service individually so we need feature layer access.

example feature layer

example with same service but dynamic access

anyone experience this issue?

I just realized that even the spacing is different...

Bruno

0 Kudos
5 Replies
KellyHutchins
Esri Frequent Contributor

Bruno,

Use a dynamic layer in combination with a feature layer in selection only mode. The dynamic layer will give you the symbology that you need and the Feature Layer in selection mode will give you access to the features as needed. There's a sample in the JSAPI help that shows how to edit features in a feature layer and use the dynamic layer for display: Editor widget with feature layer in selection mode | ArcGIS API for JavaScript

0 Kudos
BrunoAvard1
New Contributor II

Hi Kelly,

your idea is valid only if there is a single layer per services. It is the case for the example I made available but my real case has 11 separates layers, making a dynamic/feature layers combination not possible.

seems that there is a problem with the type of symbology used, the renderer seems to have a problem with the "esriSFSBackwardDiagonal" style. Is this a known issue?

Renderer:

   Simple Renderer:

      Symbol: Style: esriSFSBackwardDiagonal

      Color:  [230, 0, 0, 255]

      Outline: Style: esriSLSSolid

      Color: [0, 0, 0, 0]

   Width:   1

   Label:  Protected Area

   Description:

   Transparency:  0

   Labeling Info:

0 Kudos
KellyHutchins
Esri Frequent Contributor

The issue is rendering on the client (Feature Layer) vs rendering on the server (dynamic). The server has the ability to render more advanced symbology. Having 11 separate layers shouldn't be a problem. You'd add the dynamic layer once then each of the 11 layers as feature layers. Because they are in selection only mode they won't draw but will be available if you need to select the features in order to work with them. 

Can you provide more details on why you need individual feature access?

0 Kudos
BrunoAvard1
New Contributor II

Kelly,

we are working on popups and data tables so the feature layers are useful.

The need to access layers individually is to allow the user to choose layer visibility, maybe certain layers from a service are not useful for a specific map\application.

Take for example this service from the Northwest Territories.

GNWT/BiologicEcologic_LCC (MapServer)

Very good source of information but I only need a few layers for a mines project study.

To get back to the symbology problem, it seem that this is normal and not a problem from the setting of the service itself.

I did not think that red 45 degree lines to be complex but I don't have a clue as to how the render-er operates.

Is there other symbology service publisher should stay away from if they plan on using feature layers?

0 Kudos
KellyHutchins
Esri Frequent Contributor

Bruno,

In regards to the symbology take a look at the 'Defining the symbology' section of this help topic:

ArcGIS Help (10.2, 10.2.1, and 10.2.2)

0 Kudos