Labels all grouped together

68
4
Jump to solution
10-21-2019 11:23 AM
Highlighted
New Contributor II

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)
Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
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
Highlighted
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".

Reply
0 Kudos
Highlighted
New Contributor II

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 
                }
              ]
            }
          ]
        });
Reply
0 Kudos
Highlighted
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

Highlighted
New Contributor II

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!