Select to view content in your preferred language

Use HTML/CSS in Label on Feature Layer/Limit Number of Lines

122
0
a month ago
RaeHush
New Contributor

I'm trying to do a text-overflow for a label in a Feature Layer that will start after 2 lines. I was thinking if I could add HTML to make it work, but am unsure how.

 

LABEL CODE:

const labelingInfo = [ {
  labelExpressionInfo: {
    expression:"$feature.name"
  },
  labelPlacement: "below-center",
  symbol: {
    type: "text", // autocasts as new TextSymbol()
    backgroundColor: "#80413737",
    lineWidth: 20,
    haloColor: "#413737",
    haloSize: 1,
    font: {
      size: 12,
      family: "Poppins",
      weight: "bold",
    },
    horizontalAlignment: "left",
    color: "#FFFFFF",
  },
} ]
 

Current:

RaeHush_1-1723060899484.png

Intended:

RaeHush_0-1723060770838.png

 

Tags (2)
0 Kudos
0 Replies