Issues with LabelLayer v3.7

917
4
09-30-2013 09:03 AM
ZachLiu1
Occasional Contributor II
Just tried out the new LabelLayer Class and explored many options. It is really great.

But there are some small issues about position, especially when labels conflict with each other.

An obvious example is in the sample. For small states like MA, CT, RI, only Rhode Island can be labeled on the map at the default scale, which is usually not what people want.

It is better to have options to set certain rules to solve these problems, like what can be done in ArcGIS Desktop.

[ATTACH=CONFIG]27879[/ATTACH]

But overall it's a great addition.:)
0 Kudos
4 Replies
TracySchloss
Frequent Contributor

I'm experiencing a similar problem.  I've looked through the reference, but I don't see anything that lets you place overlapping labels.  When I noticing is that no matter how far I zoom in, I have at least one label that never does draw.   These are my county boundaries, which I use all the time, so I can't imagine there is anything wrong the layer itself.  This county is shaped a little differently, sort of an upside down L.  I wonder if the labeling for polygons is based on extent.  In this case the center of that extent doesn't fall within the polygon itself.  The county name is Iron,  so it's not like its a long name!

It seems like a bug to me.  I'm using version 3.10 of the API.

countyLabel.png

0 Kudos
DavidColey
Frequent Contributor

There's something going on with the algorithm.  I'm getting the same thing.  A very simple case below shows a label layer applied to a half-township section grid. I am also at 3.10 and still get missing labels, regardless of various parameter changes I've applied

HalfSectionLabels.PNG

0 Kudos
TracySchloss
Frequent Contributor

I think it might be specific to version 3.10. I have some slightly older code at version 3.9, and it draws fine.  If I switch my 3.10 references to 3.9, it works. I take that back.  In the 3.9 version, it wanted the field name as ${fieldname}.  In 3.10, it only worked if without the $.  Obviously there's been some changes made between the version.  Let's hope ESRI staff read these threads for this sort of thing.

0 Kudos
KenBuja
MVP Esteemed Contributor

Tracy,

You can always call attention to a person (like one of the Javascript API experts) in a post by using @ then typing their name. Like this Tracy Schloss‌. This will put an alert into their mailbox.

0 Kudos