Labels all grouped together

705
4
Jump to solution
10-21-2019 11:23 AM
DiegoMonge_Chinchilla
New Contributor III

Hello everyone

I'm trying to label an ImageLayer but all labels grouped all together:

labels all together arcgis javascript js 4.13

I'm labeling with this:

labelingInfo: [
                {
                  labelExpression: '[Contour] CONCAT "mm"',
                  labelPlacement: "always-horizontal",
                  minScale: 2000000
                  maxScale: 1000 
                }
              ]
            }
          ]

I would like to see only the label of the feature or features that I'm watching. Thanks for any help that you can give me!

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
Noah-Sager
Esri Regular Contributor

Unfortunately, I think the issue you are seeing is caused by the data. Each feature (polygon) is labeled as close to the centroid as possible. So if there are no outlines for the features, it can appear that there is groupings when really there aren't.

Simplified sample using FeatureLayer instead of MapImageLayer

https://codepen.io/noash/pen/abbpwjN 

View solution in original post

4 Replies
Noah-Sager
Esri Regular Contributor

Hi Diego, what version of the API are you using, and what specific layer are you labeling? I'm not 100% sure what you mean by "ImageLayer".

0 Kudos
DiegoMonge_Chinchilla
New Contributor III

Hi Noah 

Sorry I forgot to tell that I´m using version 4.13.

What I meant with "ImageLayer" is for a MapImageLayer

I using this layer:

 const layer = new MapImageLayer({
          url: "https://sig.icafe.cr/server/rest/services/pronosticos_image/MapServer",
          sublayers: [
            {
              id: 0,
              //popupTemplate: popup,
              renderer: renderer,
              opacity: 0.6,
              labelingInfo: [
                {
                  labelExpression: '[Contour] CONCAT "mm"',
                  labelPlacement: "always-horizontal",
                  minScale: 2000000
                  maxScale: 1000 
                }
              ]
            }
          ]
        });
0 Kudos
Noah-Sager
Esri Regular Contributor

Unfortunately, I think the issue you are seeing is caused by the data. Each feature (polygon) is labeled as close to the centroid as possible. So if there are no outlines for the features, it can appear that there is groupings when really there aren't.

Simplified sample using FeatureLayer instead of MapImageLayer

https://codepen.io/noash/pen/abbpwjN 

DiegoMonge_Chinchilla
New Contributor III

Noah thanks a lot,  I took it from NOAA and uploaded to the server with an arcpy script, seems that now they are making an overlapping of features :S,  I didn't realice about that change, now I have to solve that, thank you very much!