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-maptiler.api
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ public final class com.mapconductor.maptiler.marker.MapTilerClusterMarkerRendere
public java.lang.Object onPostProcess(kotlin.coroutines.Continuation<? super kotlin.Unit>);
public void onDragSelectionChanged(com.mapconductor.core.marker.MarkerEntityInterface<java.lang.Object>, com.mapconductor.core.marker.MarkerEntityInterface<java.lang.Object>);
public void onDragPositionChanged(com.mapconductor.core.features.GeoPointInterface);
public java.lang.Object onDrawOrderFrameChanged(com.mapconductor.core.marker.MarkerDrawOrder$Frame, java.util.List<? extends com.mapconductor.core.marker.MarkerEntityInterface<java.lang.Object>>, kotlin.coroutines.Continuation<? super kotlin.Unit>);
}
public final class com.mapconductor.maptiler.marker.MapTilerMarkerTileRenderer {
public static final double TILE_SIZE;
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/com/mapconductor/maptiler/MapTilerMapView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ import com.mapconductor.core.map.VectorStyleAsDesign
import com.mapconductor.core.map.VectorStyleMutationSupportKey
import com.mapconductor.core.map.VectorStyleSupportKey
import com.mapconductor.core.map.applyStyleMutations
import com.mapconductor.core.marker.MarkerDrawOrder
import com.mapconductor.core.marker.MarkerRenderingSupportKey
import com.mapconductor.core.marker.MarkerTilingOptions
import com.mapconductor.core.marker.rememberMarkerDrawOrderFrame
import com.maptiler.maptilersdk.events.MTEvent
import com.maptiler.maptilersdk.map.MTMapOptions
import com.maptiler.maptilersdk.map.MTMapView
Expand Down Expand Up @@ -426,8 +428,12 @@ fun MapTilerMapSurface(
styleVariant = design.variant,
)

// 地図が回って止まったら、同じ zIndex の前後を画面の上下で並べ直す。
val drawOrderFrame = rememberMarkerDrawOrderFrame { state.cameraPosition }
if (mapReady) {
markers.forEach { markerState ->
// 後に置いたものほど上に描かれる。zIndex が大きいほど、同じなら画面で下ほど上
// ([MarkerDrawOrder])。足した順には任せない。
markers.sortedBy { MarkerDrawOrder.of(it.zIndex, it.position, drawOrderFrame) }.forEach { markerState ->
key(markerState.id) {
MapTilerMarkerOverlay(mtController, markerState)
}
Expand Down
Loading