Label a Multipoint Layer in ArcGIS JavaScript API

2408
7
02-17-2021 10:36 AM
RyanSutcliffe
Occasional Contributor II

I would like to label features from a Multipoint FeatureLayer in ArcGIS JavaScript API 4x. Is this possible? I can't get it to work. 

Here is what I've tried:

let url = [my multipoint service layer url]

  var layer = new FeatureLayer({
    url: url,
    opacity: 0.9,
    renderer: {
      type: "simple", //autocasts
      symbol: {
        type: "simple-marker", //autocasts
        size: 3,
        color: "white",
      },
    },
    title: "Site Labels",
    labelingInfo : {
      labelExpressionInfo: {expression: "$feature.[myfield]"},
      symbol: {
        type: "text",
        color: "black",
        haloSize: 1,
        haloColor: "white"
      }
    },
  });

  
  var map = new Map({
    basemap: "topo",
    layers: [layer]
  });
Basically, the same way you would label a simple point layer. For a point layer this will work. No labels appear for a multipoint layer. Can't find anything online besides the statement:
Currently a feature can only have one label. If a feature satisfies the where condition of multiple LabelClasses, then only the label corresponding to the first matching LabelClass is displayed.
Which might mean that with multipoint point layers we're out of luck? 
Tags (1)
0 Kudos
7 Replies
RyanSutcliffe
Occasional Contributor II

ESRI Canada got back to me. They've logged a bug (BUG-000137586 Labels for Multipoints Fail to Render in Javascript API 4.18) for this. Just in case anyone else comes across same issue.

AnninaHirschiWyss
Occasional Contributor II

It looks like it’s in product plan now… hope it comes soon and will fix this one as well: https://support.esri.com/en-us/bug/labels-on-multipoint-layers-do-not-display-in-the-new-m-bug-00013... 

0 Kudos
Noah-Sager
Esri Regular Contributor

Thanks for getting this issue logged. We currently do not support Multipoint geometries by design, but this issue will help drive the enhancement request.

AnninaHirschiWyss
Occasional Contributor II

Any idea when this will be fixed? As this also affects the new Map Viewer in AGOL, my layer doesn't get labelled... Thx!

KrzysztofNoga
New Contributor II

Any idea when this will be fixed? ESRI JS API 4.24 still not working.

message: "Unable to create labels for Feature Layer, esriGeometryMultipoint is not supported"

name: "mapview-labeling:unsupported-geometry-type"

 

RyanSutcliffe
Occasional Contributor II

Is there somewhere that this lack of support for Multipoint in the ArcGIS JavaScript API is stated? If that is indeed the case I think you should clarify in the documentation. There is a Multipoint geometry class and certainly no mention any support limitations for labelling or otherwise there. The closest I've seen is a Technical Article for ArcGIS Online that refers to lack of support for Multipoint in the context of editing. 

 

0 Kudos
by Anonymous User
Not applicable

I would have thought this would have been fixed by now (12/3/2021) since we just had a new release of AGOL.   I will also submit a bug from our organization.