Hi we have an ESRI SDK implementation we have version 200.3.0 and we are having problems visualizing the labels in the polygons, here are some flows we checked and tried to solve, we ask for your help to find a way to solve it.
This is our current implementation for adding the labels
val graphicAttributes = mutableMapOf<String, Any>(
"identifier" to dataAttributes.identifier,
"title" to title,
"subtitle" to subtitle,
"name" to name
)
type = ArcGISGeoFeatureType.POLYGON
graphic = constructor.getGraphic(marker, graphicAttributes)
override fun getGraphic(geometry: Geometry, attributes: Map<String, Any>): Graphic {
return Graphic(geometry, attributes)
}
Hi,
Can you share the label definition that you are applying to your graphicsOverlay ?
Thanks
Rama
Sure, thanks for the help here is @RamaChintapalli
private fun makeLabelDefinition(): LabelDefinition {
val textSymbol = TextSymbol().apply {
size = 12f
color = com.arcgismaps.Color(FulcrumMarker.Color.BLACK.intColorCode())
haloColor = com.arcgismaps.Color(FulcrumMarker.Color.WHITE.intColorCode())
haloWidth = 1.5f
horizontalAlignment = HorizontalAlignment.Center
verticalAlignment = VerticalAlignment.Bottom
}
val labelExpression = ArcadeLabelExpression("\$feature.name")
val labelDefinition = LabelDefinition(labelExpression, textSymbol).apply {
stackStrategy = LabelStackStrategy.Allow
stackRowLength = 18.0
}
return labelDefinition
}
I tried your label definition which seems to work fine. Is it possible that the name is returning empty string for certain graphics in your case? Also, assuming they are all part of the same graphics overlay with labels enabled.
If the issue is still present, would you be able to repro it with this sample . Add your label definition, provide the geometry of non-working polygons in the repro code?
Thanks
Rama
Hi @RamaChintapalli thanks for answering, reviewing what you say that maybe we have empty strings, we already did that test, even the curious thing is that the labels are not seen in the same polygons in the two platforms, try in android to burn the attributes to show you that even so the labels are still not seen, I attach the portion of code of the test and the screens where you can see the test in android and ios that the same labels are not displayed either
override fun getGraphic(geometry: Geometry, attributes: Map<String, Any>): Graphic {
val newAttributes = linkedMapOf(
"identifier" to "testidentifier ",
"title" to "testtitle",
"subtitle" to "testsubtitle",
"name" to "testname"
)
return Graphic(geometry, newAttributes)
}