Select to view content in your preferred language

Label a Multipoint Layer in ArcGIS JavaScript API

3811
11
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)
11 Replies
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! 

AnninaHirschiWyss
Frequent Contributor

The Bug https://support.esri.com/en-us/bug/labels-on-multipoint-layers-do-not-display-in-the-new-m-bug-00013... is considered now as "Known Limit", is there really no way to fix this?

0 Kudos