ArcGIS Javascript API - Label renderers from Map Service for a FeatureLayer

1219
4
Jump to solution
06-13-2017 05:42 AM
MaximeDemers
Occasional Contributor III

I wonder if it is possible to use the labels renderers defined in a .mxd published as a Map Service (Feature Access enabled) for a FeatureLayer with the javascript API v4.3 just like it works with the geometry renderer?

I define a featureLayer like this:

var organismesLayer = new FeatureLayer({
  url: "https://infogeo.education.gouv.qc.ca/arcgis/rest/services/SandBox_Maxime/GDUNO/MapServer/1",
  labelsVisible: true
});‍‍‍‍

In the map, I see the layer style is the same than in the .mxd, but the labels are not visible. Do I have to define the LabelClass manually in the javascript code?

Is there a way to get the label renderers from the Map Service?

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Maxime.

   Have you seen this limitation?

Known Limitations

There is no support for labeling in 2D. Labeling is only supported in 3D

View solution in original post

4 Replies
RobertScheitlin__GISP
MVP Emeritus
0 Kudos
MaximeDemers
Occasional Contributor III

Hi Robert,

You example is using a MapImageLayer, but I am asking about a FeatureLayer. And I see in the example that they creating the LabelClass used as label renderers instead of getting it from the service.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Maxime.

   Have you seen this limitation?

Known Limitations

There is no support for labeling in 2D. Labeling is only supported in 3D

MaximeDemers
Occasional Contributor III

Oh! That's right. I think I'll go back to v.3.20 then

Thank you very much !