Added function to draw custom markers with Kotlin DSL Canvas API #1

Merged
ArystanK merged 3 commits from main into main 2022-07-16 19:28:06 +03:00
2 changed files with 2 additions and 6 deletions
Showing only changes of commit ad058e14b5 - Show all commits

View File

@ -21,7 +21,6 @@ expect fun MapView(
computeViewPoint: (canvasSize: DpSize) -> MapViewPoint,
features: Map<FeatureId, MapFeature>,
onClick: MapViewPoint.() -> Unit = {},
onFeatureClick: (FeatureId) -> Unit = {},
//TODO consider replacing by modifier
config: MapViewConfig = MapViewConfig(),
modifier: Modifier = Modifier.fillMaxSize(),
@ -33,14 +32,13 @@ fun MapView(
initialViewPoint: MapViewPoint,
features: Map<FeatureId, MapFeature> = emptyMap(),
onClick: MapViewPoint.() -> Unit = {},
onFeatureClick: (FeatureId) -> Unit = {},
config: MapViewConfig = MapViewConfig(),
modifier: Modifier = Modifier.fillMaxSize(),
buildFeatures: @Composable (FeatureBuilder.() -> Unit) = {},
) {
val featuresBuilder = MapFeatureBuilder(features)
featuresBuilder.buildFeatures()
MapView(mapTileProvider, { initialViewPoint }, featuresBuilder.build(), onClick, onFeatureClick, config, modifier)
MapView(mapTileProvider, { initialViewPoint }, featuresBuilder.build(), onClick, config, modifier)
}
@Composable
@ -49,7 +47,6 @@ fun MapView(
box: GmcBox,
features: Map<FeatureId, MapFeature> = emptyMap(),
onClick: MapViewPoint.() -> Unit = {},
onFeatureClick: (FeatureId) -> Unit = {},
config: MapViewConfig = MapViewConfig(),
modifier: Modifier = Modifier.fillMaxSize(),
buildFeatures: @Composable (FeatureBuilder.() -> Unit) = {},
@ -65,5 +62,5 @@ fun MapView(
)
MapViewPoint(box.center, zoom)
}
MapView(mapTileProvider, computeViewPoint, featuresBuilder.build(), onClick, onFeatureClick, config, modifier)
MapView(mapTileProvider, computeViewPoint, featuresBuilder.build(), onClick, config, modifier)
}

View File

@ -41,7 +41,6 @@ actual fun MapView(
computeViewPoint: (canvasSize: DpSize) -> MapViewPoint,
features: Map<FeatureId, MapFeature>,
onClick: MapViewPoint.() -> Unit,
onFeatureClick: (FeatureId) -> Unit,
config: MapViewConfig,
modifier: Modifier,
) {