I have a point feature class that I am labelling with the string "EXIT" for a majority of points, but some points will be longer, such as "EXIT into Pacific".

I wrote a labeling script that will create a new line after "EXIT", but not after "into" because I want to keep "into Pacific" on one line.

I want the label to show up like this:

 into Pacific

But instead, it automatically creates a new line and shows up like this:


Is there a way to keep ArcMap from automatically creating a new line for the label? Or is there a good invisible character that will make the program think that "into Pacific" is one string with no white space?

Here's my script:

function FindLabel ([TYPE]){
var exitSlice
var intoSlice
intoSlice = ""
var label
var field
field = [TYPE]
exitSlice = field.slice(0, 4)
if (field.length > 4) {
    intoSlice = field.slice(5)
    label = exitSlice + "\n" + "<ITA><FNT name='Melior' size='8'>" + intoSlice + "</FNT></ITA>"
else {
    label = exitSlice
return label}

I'm pretty confident the script isn't causing the extra newline between "into" and "Pacific".


I answered this over in this other question, with a reference back to this one. Short version is that with Maplex, you can probably do it, but I don't think that there's a solution you can apply to an individual label, unless you're willing to make annotation on a case-by-case basis (editorial comment:ick).

| improve this answer | |

Is this without Maplex? (I assume since it isn't mentioned). You might try setting your labelweight higher. I'm not sure how to apply it in script form but the Maplex engine at 10.0 defaults to stacked labels with space and comma as splitters.

Here is the Jave api for Maplex... resource center

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.