Select to view content in your preferred language

Label a Multipoint Layer in ArcGIS JavaScript API

3129
10
02-17-2021 10:36 AM
RyanSutcliffe
Frequent Contributor

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)
10 Replies
RyanSutcliffe
Frequent Contributor

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
Frequent Contributor

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
Frequent Contributor

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
Emerging Contributor

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"

 

AnninaHirschiWyss
Frequent Contributor

Hi @Noah-Sager ,

some of the related issues logged are "not addressed", "known limit"... Could you give some priority to this issue? It is rather important for us, as converting multipoints to single points is not an option (we have a related table to the feature and this would disturb the data integrity...)

https://support.esri.com/en-us/bug/unable-to-add-points-in-a-multipoint-feature-service-in-bug-00010...

https://support.esri.com/en-us/bug/labels-on-multipoint-layers-do-not-display-in-the-new-m-bug-00013...

 

And one "in product plan" since more than 3 years... https://support.esri.com/en-us/bug/multipoint-labels-fail-to-render-in-an-arcgis-api-for-j-bug-00013...

And one "under consideration" since more than 3 years... https://support.esri.com/en-us/bug/there-are-problems-with-adding-or-submitting-multipoint-bug-00014...

 

Thanks

0 Kudos
RyanSutcliffe
Frequent Contributor

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.

JwHayes
Regular Contributor

Oh my giggles. I can't believe this, but yet I can. This is a huge issue for my organization. Support all your geometries ESRI!