Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/android-for-mapbox.api
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ public final class com.mapconductor.mapbox.marker.MapboxMarkerOverlayRenderer ex
public void setMarkerPosition(com.mapconductor.core.marker.MarkerEntityInterface<com.mapbox.geojson.Feature>, com.mapconductor.core.features.GeoPoint);
public java.lang.Object onAdd(java.util.List<? extends com.mapconductor.core.marker.MarkerOverlayRendererInterface$AddParamsInterface>, kotlin.coroutines.Continuation<? super java.util.List<com.mapbox.geojson.Feature>>);
public java.lang.Object onRemove(java.util.List<? extends com.mapconductor.core.marker.MarkerEntityInterface<com.mapbox.geojson.Feature>>, kotlin.coroutines.Continuation<? super kotlin.Unit>);
protected java.lang.Object applyDrawOrder(java.util.List<? extends com.mapconductor.core.marker.MarkerEntityInterface<com.mapbox.geojson.Feature>>, kotlin.coroutines.Continuation<? super kotlin.Unit>);
public java.lang.Object onPostProcess(kotlin.coroutines.Continuation<? super kotlin.Unit>);
public java.lang.Object onChange(java.util.List<? extends com.mapconductor.core.marker.MarkerOverlayRendererInterface$ChangeParamsInterface<com.mapbox.geojson.Feature>>, kotlin.coroutines.Continuation<? super java.util.List<com.mapbox.geojson.Feature>>);
public void onDragSelectionChanged(com.mapconductor.core.marker.MarkerEntityInterface<com.mapbox.geojson.Feature>, com.mapconductor.core.marker.MarkerEntityInterface<com.mapbox.geojson.Feature>);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import com.google.gson.JsonObject
import com.mapbox.geojson.Feature
import com.mapbox.geojson.FeatureCollection
import com.mapconductor.core.ResourceProvider
import com.mapconductor.core.calculateZIndex
import com.mapconductor.core.features.GeoPoint
import com.mapconductor.core.features.GeoPointInterface
import com.mapconductor.core.marker.AbstractMarkerOverlayRenderer
import com.mapconductor.core.marker.BitmapIcon
import com.mapconductor.core.marker.DefaultMarkerIcon
import com.mapconductor.core.marker.MarkerDrawOrder
import com.mapconductor.core.marker.MarkerEntityInterface
import com.mapconductor.core.marker.MarkerIconInterface
import com.mapconductor.core.marker.MarkerManager
Expand Down Expand Up @@ -184,7 +184,7 @@ class MapboxMarkerOverlayRenderer(
val props = (markerEntity.marker?.properties() ?: JsonObject()).deepCopy()
props.addProperty(
Prop.Z_INDEX,
markerEntity.state.zIndex ?: calculateZIndex(position),
MarkerDrawOrder.of(markerEntity.state.zIndex, position, drawOrderFrame),
)
val feature =
Feature.fromGeometry(
Expand Down Expand Up @@ -246,7 +246,7 @@ class MapboxMarkerOverlayRenderer(
add(Prop.ICON_ANCHOR, getDefaultIconOffsetProperty())
}
addProperty(Prop.SCALE, it.state.icon?.scale ?: 1.0)
addProperty(Prop.Z_INDEX, it.state.zIndex ?: calculateZIndex(it.state.position))
addProperty(Prop.Z_INDEX, drawOrderOf(it.state))
}
Feature.fromGeometry(position, properties, featureId)
}
Expand All @@ -271,6 +271,17 @@ class MapboxMarkerOverlayRenderer(
}
}

// 地図が回ったら、各フィーチャーの並び順キー(symbol-sort-key)を付け直して流し直す。
override suspend fun applyDrawOrder(entities: List<MarkerEntityInterface<MapboxActualMarker>>) {
val target = entities.filter { !it.tiling }
withContext(Dispatchers.Main) {
target.forEach { entity ->
entity.marker?.properties()?.addProperty(Prop.Z_INDEX, drawOrderOf(entity.state))
}
markerLayer.draw(target)
}
}

override suspend fun onPostProcess() {
val target = markerManager.allEntities().filter { !it.tiling }

Expand Down Expand Up @@ -335,7 +346,7 @@ class MapboxMarkerOverlayRenderer(
)
addProperty(
Prop.Z_INDEX,
params.current.state.zIndex ?: calculateZIndex(params.current.state.position),
drawOrderOf(params.current.state),
)
if (currFinger.icon == prevFinger.icon) {
addProperty(
Expand Down
Loading