From 6bfe983f8d627b51dbe8ed9ec0102a3ab36f2529 Mon Sep 17 00:00:00 2001 From: Shubham Sharma Date: Fri, 27 Oct 2023 11:42:22 -0700 Subject: [PATCH 1/5] added SelectionProperties --- .../java/com/arcgismaps/toolkit/geocompose/MapView.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/toolkit/geo-compose/src/main/java/com/arcgismaps/toolkit/geocompose/MapView.kt b/toolkit/geo-compose/src/main/java/com/arcgismaps/toolkit/geocompose/MapView.kt index b39a627f1..b1e68330f 100644 --- a/toolkit/geo-compose/src/main/java/com/arcgismaps/toolkit/geocompose/MapView.kt +++ b/toolkit/geo-compose/src/main/java/com/arcgismaps/toolkit/geocompose/MapView.kt @@ -36,6 +36,7 @@ import com.arcgismaps.mapping.ArcGISMap import com.arcgismaps.mapping.view.LocationDisplay import com.arcgismaps.mapping.view.MapView import com.arcgismaps.mapping.view.MapViewInteractionOptions +import com.arcgismaps.mapping.view.SelectionProperties import kotlinx.coroutines.launch /** @@ -43,6 +44,11 @@ import kotlinx.coroutines.launch */ public val MapViewInteractionOptionDefaults: MapViewInteractionOptions = MapViewInteractionOptions() +/** + * The default instance of [SelectionProperties] + */ +public val MapViewDefaultSelectionProperties: SelectionProperties = SelectionProperties() + /** * A compose equivalent of the [MapView]. * @@ -58,6 +64,7 @@ public val MapViewInteractionOptionDefaults: MapViewInteractionOptions = MapView public fun MapView( modifier: Modifier = Modifier, arcGISMap: ArcGISMap? = null, + selectionProperties: SelectionProperties = MapViewDefaultSelectionProperties, locationDisplay: LocationDisplay = rememberLocationDisplay(), mapViewInteractionOptions: MapViewInteractionOptions = MapViewInteractionOptionDefaults, onViewpointChanged: (() -> Unit)? = null, @@ -77,6 +84,7 @@ public fun MapView( factory = { mapView }, update = { it.map = arcGISMap + it.selectionProperties = selectionProperties it.interactionOptions = mapViewInteractionOptions it.locationDisplay = locationDisplay }) From 1d234cd495c7bddae1b5e5c4d6231f5c804b5e35 Mon Sep 17 00:00:00 2001 From: Shubham Sharma Date: Fri, 27 Oct 2023 11:45:31 -0700 Subject: [PATCH 2/5] reformat --- .../src/main/java/com/arcgismaps/toolkit/geocompose/MapView.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolkit/geo-compose/src/main/java/com/arcgismaps/toolkit/geocompose/MapView.kt b/toolkit/geo-compose/src/main/java/com/arcgismaps/toolkit/geocompose/MapView.kt index b1e68330f..e64a6c16b 100644 --- a/toolkit/geo-compose/src/main/java/com/arcgismaps/toolkit/geocompose/MapView.kt +++ b/toolkit/geo-compose/src/main/java/com/arcgismaps/toolkit/geocompose/MapView.kt @@ -64,9 +64,9 @@ public val MapViewDefaultSelectionProperties: SelectionProperties = SelectionPro public fun MapView( modifier: Modifier = Modifier, arcGISMap: ArcGISMap? = null, - selectionProperties: SelectionProperties = MapViewDefaultSelectionProperties, locationDisplay: LocationDisplay = rememberLocationDisplay(), mapViewInteractionOptions: MapViewInteractionOptions = MapViewInteractionOptionDefaults, + selectionProperties: SelectionProperties = MapViewDefaultSelectionProperties, onViewpointChanged: (() -> Unit)? = null, overlay: @Composable () -> Unit = {} ) { From 48822167a2ac3b017e10097031015589d77eba81 Mon Sep 17 00:00:00 2001 From: Shubham Sharma Date: Mon, 30 Oct 2023 11:42:09 -0700 Subject: [PATCH 3/5] PR feedback --- .../main/java/com/arcgismaps/toolkit/geocompose/MapView.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/toolkit/geo-compose/src/main/java/com/arcgismaps/toolkit/geocompose/MapView.kt b/toolkit/geo-compose/src/main/java/com/arcgismaps/toolkit/geocompose/MapView.kt index e64a6c16b..92e36d224 100644 --- a/toolkit/geo-compose/src/main/java/com/arcgismaps/toolkit/geocompose/MapView.kt +++ b/toolkit/geo-compose/src/main/java/com/arcgismaps/toolkit/geocompose/MapView.kt @@ -47,7 +47,7 @@ public val MapViewInteractionOptionDefaults: MapViewInteractionOptions = MapView /** * The default instance of [SelectionProperties] */ -public val MapViewDefaultSelectionProperties: SelectionProperties = SelectionProperties() +public val MapViewSelectionPropertiesDefaults: SelectionProperties = SelectionProperties() /** * A compose equivalent of the [MapView]. @@ -56,6 +56,7 @@ public val MapViewDefaultSelectionProperties: SelectionProperties = SelectionPro * @param arcGISMap the [ArcGISMap] to be rendered by this composable * @param locationDisplay the [LocationDisplay] used by the composable [com.arcgismaps.toolkit.geocompose.MapView] * @param mapViewInteractionOptions the [MapViewInteractionOptions] used by this composable [com.arcgismaps.toolkit.geocompose.MapView] + * @param selectionProperties the [SelectionProperties] used by the composable [com.arcgismaps.toolkit.geocompose.MapView] to set a selection color. * @param onViewpointChanged lambda invoked when the viewpoint of the composable MapView has changed * @param overlay the composable overlays to display on top of the composable MapView. Example, a compass, floorfilter etc. * @since 200.3.0 @@ -66,7 +67,7 @@ public fun MapView( arcGISMap: ArcGISMap? = null, locationDisplay: LocationDisplay = rememberLocationDisplay(), mapViewInteractionOptions: MapViewInteractionOptions = MapViewInteractionOptionDefaults, - selectionProperties: SelectionProperties = MapViewDefaultSelectionProperties, + selectionProperties: SelectionProperties = MapViewSelectionPropertiesDefaults, onViewpointChanged: (() -> Unit)? = null, overlay: @Composable () -> Unit = {} ) { From 069f4a44fc68e8ecdff65884b2dba85452c55bb6 Mon Sep 17 00:00:00 2001 From: Shubham Sharma Date: Mon, 30 Oct 2023 14:40:19 -0700 Subject: [PATCH 4/5] PR feedback --- .../java/com/arcgismaps/toolkit/geocompose/MapView.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/toolkit/geo-compose/src/main/java/com/arcgismaps/toolkit/geocompose/MapView.kt b/toolkit/geo-compose/src/main/java/com/arcgismaps/toolkit/geocompose/MapView.kt index e2d0639ec..1a13f7c03 100644 --- a/toolkit/geo-compose/src/main/java/com/arcgismaps/toolkit/geocompose/MapView.kt +++ b/toolkit/geo-compose/src/main/java/com/arcgismaps/toolkit/geocompose/MapView.kt @@ -43,12 +43,12 @@ import kotlinx.coroutines.launch /** * The default instance of [MapViewInteractionOptions] */ -public val MapViewInteractionOptionDefaults: MapViewInteractionOptions = MapViewInteractionOptions() +public val DefaultMapViewInteractionOptions: MapViewInteractionOptions = MapViewInteractionOptions() /** * The default instance of [SelectionProperties] */ -public val MapViewSelectionPropertiesDefaults: SelectionProperties = SelectionProperties() +public val DefaultMapViewSelectionProperties: SelectionProperties = SelectionProperties() /** * A compose equivalent of the [MapView]. @@ -58,7 +58,7 @@ public val MapViewSelectionPropertiesDefaults: SelectionProperties = SelectionPr * @param locationDisplay the [LocationDisplay] used by the composable [com.arcgismaps.toolkit.geocompose.MapView] * @param geometryEditor the [GeometryEditor] used by the composable [com.arcgismaps.toolkit.geocompose.MapView] to create and edit geometries by user interaction. * @param mapViewInteractionOptions the [MapViewInteractionOptions] used by this composable [com.arcgismaps.toolkit.geocompose.MapView] - * @param selectionProperties the [SelectionProperties] used by the composable [com.arcgismaps.toolkit.geocompose.MapView] to set a selection color. + * @param selectionProperties the [SelectionProperties] used by the composable [com.arcgismaps.toolkit.geocompose.MapView]. * @param onViewpointChanged lambda invoked when the viewpoint of the composable MapView has changed * @param overlay the composable overlays to display on top of the composable MapView. Example, a compass, floorfilter etc. * @since 200.3.0 @@ -69,8 +69,8 @@ public fun MapView( arcGISMap: ArcGISMap? = null, locationDisplay: LocationDisplay = rememberLocationDisplay(), geometryEditor: GeometryEditor? = null, - mapViewInteractionOptions: MapViewInteractionOptions = MapViewInteractionOptionDefaults, - selectionProperties: SelectionProperties = MapViewSelectionPropertiesDefaults, + mapViewInteractionOptions: MapViewInteractionOptions = DefaultMapViewInteractionOptions, + selectionProperties: SelectionProperties = DefaultMapViewSelectionProperties, onViewpointChanged: (() -> Unit)? = null, overlay: @Composable () -> Unit = {} ) { From 0872e16d4a4e1c033b461b3d0d2fdb561ab729b8 Mon Sep 17 00:00:00 2001 From: Shubham Sharma Date: Tue, 31 Oct 2023 11:50:24 -0700 Subject: [PATCH 5/5] Removed defaults --- .../com/arcgismaps/toolkit/geocompose/MapView.kt | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/toolkit/geo-compose/src/main/java/com/arcgismaps/toolkit/geocompose/MapView.kt b/toolkit/geo-compose/src/main/java/com/arcgismaps/toolkit/geocompose/MapView.kt index 1a13f7c03..6cf5adbae 100644 --- a/toolkit/geo-compose/src/main/java/com/arcgismaps/toolkit/geocompose/MapView.kt +++ b/toolkit/geo-compose/src/main/java/com/arcgismaps/toolkit/geocompose/MapView.kt @@ -40,16 +40,6 @@ import com.arcgismaps.mapping.view.SelectionProperties import com.arcgismaps.mapping.view.geometryeditor.GeometryEditor import kotlinx.coroutines.launch -/** - * The default instance of [MapViewInteractionOptions] - */ -public val DefaultMapViewInteractionOptions: MapViewInteractionOptions = MapViewInteractionOptions() - -/** - * The default instance of [SelectionProperties] - */ -public val DefaultMapViewSelectionProperties: SelectionProperties = SelectionProperties() - /** * A compose equivalent of the [MapView]. * @@ -69,8 +59,8 @@ public fun MapView( arcGISMap: ArcGISMap? = null, locationDisplay: LocationDisplay = rememberLocationDisplay(), geometryEditor: GeometryEditor? = null, - mapViewInteractionOptions: MapViewInteractionOptions = DefaultMapViewInteractionOptions, - selectionProperties: SelectionProperties = DefaultMapViewSelectionProperties, + mapViewInteractionOptions: MapViewInteractionOptions = MapViewInteractionOptions(), + selectionProperties: SelectionProperties = SelectionProperties(), onViewpointChanged: (() -> Unit)? = null, overlay: @Composable () -> Unit = {} ) {