diff --git a/api/android-sdk-compose.api b/api/android-sdk-compose.api index 964f159..bac0a49 100644 --- a/api/android-sdk-compose.api +++ b/api/android-sdk-compose.api @@ -60,7 +60,7 @@ public final class com.mapconductor.compose.map.MapAttributionOverlayKt { public static final void MapAttributionOverlay(java.util.List, androidx.compose.runtime.Composer, int); } public final class com.mapconductor.compose.map.MapViewBaseKt { - public static final , SpecificController extends com.mapconductor.core.controller.BaseMapViewController, ActualMapView extends android.view.View, ActualMap, SpecificScope extends com.mapconductor.compose.MapViewScope, SpecificHolder extends com.mapconductor.core.map.MapViewHolderInterface> void MapViewBase(SpecificState, androidx.compose.runtime.MutableState, androidx.compose.ui.Modifier, kotlin.jvm.functions.Function2, SpecificScope, com.mapconductor.core.map.MapOverlayRegistry, kotlin.jvm.functions.Function1, ? extends java.lang.Object>, kotlin.jvm.functions.Function2, ? extends java.lang.Object>, kotlin.jvm.functions.Function2, ? extends java.lang.Object>, kotlin.jvm.functions.Function1, kotlin.Unit>, kotlin.jvm.functions.Function4, ? super androidx.compose.runtime.Composer, ? super java.lang.Integer, kotlin.Unit>, kotlin.jvm.functions.Function3, androidx.compose.runtime.Composer, int, int, int); + public static final , SpecificController extends com.mapconductor.core.controller.BaseMapViewController, ActualMapView extends android.view.View, ActualMap, SpecificScope extends com.mapconductor.compose.MapViewScope, SpecificHolder extends com.mapconductor.core.map.MapViewHolderInterface> void MapViewBase(SpecificState, androidx.compose.runtime.MutableState, androidx.compose.ui.Modifier, kotlin.jvm.functions.Function2, SpecificScope, com.mapconductor.core.map.MapOverlayRegistry, kotlin.jvm.functions.Function1, ? extends java.lang.Object>, kotlin.jvm.functions.Function2, ? extends java.lang.Object>, kotlin.jvm.functions.Function2, ? extends java.lang.Object>, kotlin.jvm.functions.Function1, kotlin.Unit>, kotlin.jvm.functions.Function4, ? super androidx.compose.runtime.Composer, ? super java.lang.Integer, kotlin.Unit>, com.mapconductor.core.map.MapViewStyle, kotlin.jvm.functions.Function1, kotlin.Unit>, kotlin.jvm.functions.Function3, androidx.compose.runtime.Composer, int, int, int); } public final class com.mapconductor.compose.marker.LocalMarkerCollectorKt { public static final androidx.compose.runtime.ProvidableCompositionLocal> getLocalMarkerCollector(); diff --git a/build.gradle.kts b/build.gradle.kts index 5517ed4..47a06cf 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -104,10 +104,11 @@ val libraryName = "MapConductor Compose" val libraryDescription = "Jetpack Compose for MapConductor" // Gradle 9.6 で `by tasks.registering` は非推奨(スクリプトコンパイルエラーになる)。 -val javadocJar = tasks.register("javadocJar") { - archiveClassifier.set("javadoc") - // Since Android libraries don't have Javadoc task by default, create empty jar -} +val javadocJar = + tasks.register("javadocJar") { + archiveClassifier.set("javadoc") + // Since Android libraries don't have Javadoc task by default, create empty jar + } afterEvaluate { publishing { diff --git a/src/main/java/com/mapconductor/compose/map/MapViewBase.kt b/src/main/java/com/mapconductor/compose/map/MapViewBase.kt index f9c5e5a..8d762d8 100644 --- a/src/main/java/com/mapconductor/compose/map/MapViewBase.kt +++ b/src/main/java/com/mapconductor/compose/map/MapViewBase.kt @@ -61,10 +61,12 @@ import com.mapconductor.core.map.MapOverlayRegistry import com.mapconductor.core.map.MapPaddings import com.mapconductor.core.map.MapViewHolderInterface import com.mapconductor.core.map.MapViewStateInterface +import com.mapconductor.core.map.MapViewStyle +import com.mapconductor.core.map.MapViewStyleEffect import com.mapconductor.core.map.ScreenProjectionRequirement +import com.mapconductor.core.map.VectorStyleSupportKey import com.mapconductor.core.map.resolveMapAttributions import com.mapconductor.core.marker.MarkerCapableInterface -import com.mapconductor.core.map.VectorStyleSupportKey import com.mapconductor.core.marker.MarkerIconExtent import com.mapconductor.core.marker.MarkerRenderingSupportKey import com.mapconductor.core.polygon.PolygonCapableInterface @@ -105,6 +107,8 @@ fun < controllerProvider: suspend (holder: SpecificHolder) -> SpecificController, onMapLoaded: OnMapLoadedHandler? = null, customDisposableEffect: (@Composable (InitState, Ref) -> Unit)? = null, + style: MapViewStyle? = null, + onStyleDiagnostics: ((List) -> Unit)? = null, content: (@Composable SpecificScope.() -> Unit)? = null, ) { ResourceProvider.init(LocalContext.current) @@ -131,6 +135,16 @@ fun < } } + // How the map looks, as a property of the map. One call, every provider: + // what a style does to this particular backend is decided by what the + // backend registered it can do, not here. See `MapViewStyleEffect`. + MapViewStyleEffect( + state = state, + style = style, + controller = controller, + onDiagnostics = onStyleDiagnostics, + ) + controller?.also { controller.setMapInitializedListener { initState = InitState.MapLoaded