JavaScript 4.0 Label Points with an Attribute value ..?

3284
4
Jump to solution
04-06-2016 02:17 AM
JawadhHabeeb1
Occasional Contributor

Hi,

I am using JavaScript 4.0 for creating an Application, Is there a way to Give Labels on Point Features instead of basic Symbology, ..?

The Labels Needs to come from a Particular Value in the Attribute Table.

Regards,

Jawadh

1 Solution

Accepted Solutions
KristianEkenes
Esri Regular Contributor

Labelling does work in beta 3. The issue Marc is referring to is slightly different. It doesn't refer to data attributes. See this example of how you can add labels in 3D - Symbol layers outline

This uses polygons, but the same principles should apply to points. Here's the code for the sample: esri-js-samples/symbol-layer-outline.html at master · ekenes/esri-js-samples · GitHub

View solution in original post

4 Replies
MarcBate
Occasional Contributor II

It doesn't work with 4 beta 3.  See my post

LabelClass or TextSymbol in v4 beta 3?

Esri, please add to known issues with beta 3

0 Kudos
KristianEkenes
Esri Regular Contributor

Labelling does work in beta 3. The issue Marc is referring to is slightly different. It doesn't refer to data attributes. See this example of how you can add labels in 3D - Symbol layers outline

This uses polygons, but the same principles should apply to points. Here's the code for the sample: esri-js-samples/symbol-layer-outline.html at master · ekenes/esri-js-samples · GitHub

JawadhHabeeb1
Occasional Contributor

Now I am stuck with Displaying it in 2D now .. my application is both in 2D and 3D ..

The 3D label works very well

I think I am stuck here

var labelClass = new LabelClass({

  labelExpressionInfo: {

  value: "{Some_value}"

  },

symbol: new LabelSymbol3D({                                               ----> can these symbols be in 2D mapView also ..?

        symbolLayers: [new TextSymbol3DLayer({                   ----->

          material: { color: [49,163,84] },

          size: 15

        })

0 Kudos
KristianEkenes
Esri Regular Contributor

No. Any symbol with "3D" in its name cannot be used in MapView. MapView labels aren't supported in beta 3.

0 Kudos