Feature Layer doesn't use server drawing information

883
4
Jump to solution
10-09-2014 08:04 AM
RalucaNicola
New Contributor

I published a map that contains layers which use representations. I want to use these layers as Feature Layers in a web map, but when I add them to the map element, the symbology is different. Is there a way to keep the representation symbology? I read here that Feature Classes take the drawing information from the server, but in my case the symbology is totally different.

0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

From the overview on Feature Layers, it looks like cartographic representations are not available with Feature Layers.

  • Selection only mode does not initially request any features. Features are added only when a selection is made. This mode is useful when you cannot or do not want to bring all features into the client, but you want to highlight one or more features for a certain reason.

    For example, suppose you have a roads layer that's configured to use cartographic representations, which are not supported for display using a feature layer. You want to perform some Web editing on the roads, but that requires a feature layer. What do you do?

    In this scenario, you configure a dynamic map service to show the roads, then use a feature layer with selection only mode to display just the road currently being edited. This selected road is drawn using a simple client-side symbol. Once the edit is applied, you can clear the selection and refresh the dynamic map service to see the updated roads.

View solution in original post

0 Kudos
4 Replies
TimWitt2
MVP Alum

Raluca,

are you able to share a link to that service? Or show the code that you are using? Because it should show the symbology you used unless you specify it in your code to use different symbology .

Tim

0 Kudos
RalucaNicola
New Contributor

Hi Tim,

If I use

dynamicMapService = new ArcGISDynamicMapServiceLayer(url);

map.addLayer(dynamicMapService);

then the layers are rendered using the representations.

ww_repr.PNG

But if I add the service as a feature layer:

featureLayer = new FeatureLayer(url +  "13");

map.addLayer(featureLayer);

then my hiking trails are represented only with a green line...

ww_norepr.PNG

Thank you for your help!

Raluca

0 Kudos
KenBuja
MVP Esteemed Contributor

From the overview on Feature Layers, it looks like cartographic representations are not available with Feature Layers.

  • Selection only mode does not initially request any features. Features are added only when a selection is made. This mode is useful when you cannot or do not want to bring all features into the client, but you want to highlight one or more features for a certain reason.

    For example, suppose you have a roads layer that's configured to use cartographic representations, which are not supported for display using a feature layer. You want to perform some Web editing on the roads, but that requires a feature layer. What do you do?

    In this scenario, you configure a dynamic map service to show the roads, then use a feature layer with selection only mode to display just the road currently being edited. This selected road is drawn using a simple client-side symbol. Once the edit is applied, you can clear the selection and refresh the dynamic map service to see the updated roads.

0 Kudos
RalucaNicola
New Contributor

Thanks Ken, this is what I was looking for.

0 Kudos