Open jeffbarge opened 1 day ago
When using a Composable function with more than 1 layer, and adding to the map via layerPositionedContent, the first layer added renders on top, which is backwards from when adding the same composable to the mapContent.
layerPositionedContent
Example:
@Composable private fun PolylineBase() { val lineSource = rememberGeoJsonSourceState { data = GeoJSONData( Feature.fromGeometry( LineString.fromLngLats( listOf( Point.fromLngLat(0.0, 0.0), Point.fromLngLat(1.0, 1.0)) ))) } LineLayer(sourceState = lineSource) { lineColor = ColorValue( Color(0xFF999999) ) lineWidth = DoubleValue(12.0) lineBorderWidth = DoubleValue(2.0) lineBorderColor = ColorValue(Color(0xFF333333)) } val geoJsonSource = rememberGeoJsonSourceState { data = GeoJSONData(Point.fromLngLat(0.0, 0.0)) } SymbolLayer( sourceState = geoJsonSource ) { iconAnchor = IconAnchorValue.BOTTOM textField = FormattedValue("Hello Helsinki") textColor = ColorValue(Color.Red) textColorTransition = Transition(durationMillis = 1000) textSize = DoubleValue(20.0) textAllowOverlap = BooleanValue(true) } }
Note that the text from the SymbolLayer renders beneath the LineLayer, even though it was added last.
The last Layer added should render on top. This is the behavior when adding layers to MapContent.
Thanks for the issue. We'll let you know once we've fixed it.
(internal ticket: MAPSAND-1924)
Environment
Observed behavior and steps to reproduce
When using a Composable function with more than 1 layer, and adding to the map via
layerPositionedContent
, the first layer added renders on top, which is backwards from when adding the same composable to the mapContent.Example:
Note that the text from the SymbolLayer renders beneath the LineLayer, even though it was added last.
Expected behavior
The last Layer added should render on top. This is the behavior when adding layers to MapContent.
Notes / preliminary analysis
Additional links and references