shapeZIndexOf method

double shapeZIndexOf(
  1. String layerId,
  2. int index,
  3. int count
)

z-index of the index-th of count shapes of a layer. flutter_map paints a layer's shapes in list order; native maps only order by z-index, so later shapes get a slightly higher one. The spread stays below 0.4 so a shape never rises above the next layer, nor above the borders (zIndex - 0.5) drawn for that layer.

Implementation

double shapeZIndexOf(String layerId, int index, int count) => zIndexOf(layerId) + 0.4 * index / count;