You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#1785 added zIndex to the renderer model's PolygonStyle and applied it in MapViewRenderer.createPolygonOptions(). That works for callers who construct a PolygonStyle by hand, but nothing fills the new field from the GeoJSON path, and the point/line equivalents have no field at all.
The gap
The legacy GeoJson*Style classes have supported z-index for a long time. Each wraps a MarkerOptions/PolylineOptions/PolygonOptions and exposes getZIndex()/setZIndex():
field exists, not passed (GeoJsonLayer.kt:312, :323)
GeoJsonLineStringStyle
LineStyle
no zIndex field
GeoJsonPointStyle
PointStyle
no zIndex field
So this silently does nothing when the layer is rendered through MapViewRenderer:
val style =GeoJsonPolygonStyle().apply { setZIndex(10f) }
feature.polygonStyle = style // z-index lost on the way to PolygonOptions
This is a behavior regression relative to the legacy renderer, which called toPolygonOptions() on the style object directly and therefore kept the z-index.
Apply it in MapViewRenderer.createMarkerOptions(), createAdvancedMarkerOptions() and createPolylineOptions(), mirroring createPolygonOptions().
Pass getZIndex() through all four legacy-bridge sites in GeoJsonLayer.toModelFeature().
Out of scope
KML.<drawOrder> is an Overlay element in the KML 2.2 spec, not a Placemark one, so there is no placemark-level z-index to map. The parser models it only on GroundOverlay (KmlModel.kt:90) and KmlMapper already maps it to GroundOverlayStyle.zIndex. Nothing to do.
KmlLayer.kt:409 has the same bridge shape, but legacy KmlStyle never writes a polygon z-index, so it is always 0, a no-op.
GeoJsonMapper, which parses raw simplestyle-spec properties. That spec has no z-index key.
Follow-up to #1785 / #1784.
#1785 added
zIndexto the renderer model'sPolygonStyleand applied it inMapViewRenderer.createPolygonOptions(). That works for callers who construct aPolygonStyleby hand, but nothing fills the new field from the GeoJSON path, and the point/line equivalents have no field at all.The gap
The legacy
GeoJson*Styleclasses have supported z-index for a long time. Each wraps aMarkerOptions/PolylineOptions/PolygonOptionsand exposesgetZIndex()/setZIndex():GeoJsonPointStyle.getZIndex()(GeoJsonPointStyle.kt:112)GeoJsonLineStringStyle.getZIndex()(GeoJsonLineStringStyle.kt:61)GeoJsonPolygonStyle.getZIndex()(GeoJsonPolygonStyle.kt:74)GeoJsonLayer.toModelFeature()bridges those legacy styles into the renderer model, and drops z-index in every case:GeoJsonPolygonStylePolygonStyle.zIndex(added in #1785)GeoJsonLayer.kt:312,:323)GeoJsonLineStringStyleLineStylezIndexfieldGeoJsonPointStylePointStylezIndexfieldSo this silently does nothing when the layer is rendered through
MapViewRenderer:This is a behavior regression relative to the legacy renderer, which called
toPolygonOptions()on the style object directly and therefore kept the z-index.Proposed fix
zIndex: Float = 0.0fto the modelPointStyleandLineStyle, mirroring the property feat: add polygon z-index support toPolygonStyle/MapViewRenderer#1785 added toPolygonStyle. Additive and backward compatible.MapViewRenderer.createMarkerOptions(),createAdvancedMarkerOptions()andcreatePolylineOptions(), mirroringcreatePolygonOptions().getZIndex()through all four legacy-bridge sites inGeoJsonLayer.toModelFeature().Out of scope
<drawOrder>is anOverlayelement in the KML 2.2 spec, not aPlacemarkone, so there is no placemark-level z-index to map. The parser models it only onGroundOverlay(KmlModel.kt:90) andKmlMapperalready maps it toGroundOverlayStyle.zIndex. Nothing to do.KmlLayer.kt:409has the same bridge shape, but legacyKmlStylenever writes a polygon z-index, so it is always 0, a no-op.GeoJsonMapper, which parses rawsimplestyle-specproperties. That spec has no z-index key.