Skip to content

Feature branches/geo compose #355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 92 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
e9f7319
Implements setting and modifying a map/layers (#136)
puneet-pdx Oct 10, 2023
88ca66d
add overlay support (#143)
puneet-pdx Oct 12, 2023
18a4db3
remove MapState
gunt0001 Oct 18, 2023
67da63d
Merge pull request #154 from Esri/gunther/clean_up_feature_branch
gunt0001 Oct 19, 2023
9878cb8
Merge branch 'v.next' into feature-branches/geo-compose
puneet-pdx Oct 19, 2023
fa1e0e9
add viewpointChangedLambda (#159)
puneet-pdx Oct 24, 2023
2c1d7ad
Support LocationDisplay (#160)
gunt0001 Oct 24, 2023
cf675ae
Compose Map InteractionOptions (#163)
shubham7109 Oct 24, 2023
2842b23
Rename - Compose MapView (#165)
shubham7109 Oct 25, 2023
77b32d2
Compose MapView: Geometry editor (#170)
shubham7109 Oct 30, 2023
b89c9b5
Compose MapView: SelectionProperties (#173)
shubham7109 Oct 31, 2023
ec9a786
add support for WrapAroundMode (#176)
puneet-pdx Oct 31, 2023
2e00949
Compose MapView: ViewLabelProperties (#174)
shubham7109 Oct 31, 2023
ed86a27
add implementation for gesture events (#172)
puneet-pdx Nov 1, 2023
49179d6
Compose Map - graphics overlay (#166)
shubham7109 Nov 2, 2023
ae254e0
moved GraphicsOverlaysUpdater (#183)
shubham7109 Nov 2, 2023
aca38eb
added grid & backgroundGrid impl (#192)
shubham7109 Nov 7, 2023
ccd7e22
Draw Status (#186)
shubham7109 Nov 7, 2023
faeab75
Geometry editor micro-app (#178)
shubham7109 Nov 8, 2023
f754e84
added invoke (#197)
shubham7109 Nov 9, 2023
fda1735
Update MapView doc pattern (#191)
shubham7109 Nov 9, 2023
6dc7218
add support for attribution text (#187)
puneet-pdx Nov 9, 2023
1e72669
Add spatialreference changed callback (#193)
hud10837 Nov 10, 2023
766bad6
MapView Rotation & Scale (#195)
shubham7109 Nov 13, 2023
04ec3e5
Add inset support (#182)
puneet-pdx Nov 13, 2023
91d5842
Add mapview proxy (#190)
hud10837 Nov 13, 2023
1886835
update the copyright to the apache License (#203)
puneet-pdx Nov 13, 2023
32e5a4a
add support for onNavigationChanged (#199)
puneet-pdx Nov 13, 2023
0e75d3a
MapView TimeExtent (#194)
shubham7109 Nov 14, 2023
90a68f9
Support for setting Viewpoint on MapView (#202)
gunt0001 Nov 16, 2023
7801bc6
Refactor mapview insets app (#206)
puneet-pdx Nov 16, 2023
75f166e
update all since tags in geo-compose module (#227)
hud10837 Dec 11, 2023
5f7df69
Geo-compose: add identify methods and microapp (#223)
hud10837 Dec 11, 2023
a77ac0b
Rename MapView-related microapps to have MapView prefix (#226)
hud10837 Dec 11, 2023
bfb88ae
add onUnitsPerDipChanged callback lambda (#232)
puneet-pdx Dec 12, 2023
e7dedd8
Add exportImage fun to GeoViewProxy (#233)
puneet-pdx Dec 12, 2023
6a1d412
add isWrapAroundEnabled property to GeoViewProxy (#231)
puneet-pdx Dec 13, 2023
a6e0933
Geo-compose: add basic SceneView function (#230)
hud10837 Dec 14, 2023
b3d508f
added compose BOM (#237)
shubham7109 Dec 14, 2023
dc466f6
add ViewPointState (#234)
puneet-pdx Dec 14, 2023
1360602
Hud10837/layer view state (#228)
hud10837 Dec 15, 2023
6c33b06
SceneView: add sceneview gesture events (#241)
hud10837 Dec 18, 2023
4c26838
SceneView: create SceneViewProxy (#246)
hud10837 Dec 19, 2023
1db92bf
SceneView: graphics overlays (#245)
hud10837 Dec 19, 2023
54302bd
SceneView: add scene viewpoint operation (#240)
hud10837 Dec 19, 2023
aa35df9
Update feature branch with v.next (#243)
shubham7109 Dec 19, 2023
24227b5
add navigationchanged to sceneview (#248)
hud10837 Dec 20, 2023
300fbb1
SceneView: add ViewLabelProperties (#249)
hud10837 Dec 20, 2023
7326422
SceneView: attribution (#247)
hud10837 Dec 20, 2023
d1b4305
Update toolkit/geo-compose/src/main/java/com/arcgismaps/toolkit/geoco…
changanxian Dec 21, 2023
ac5a367
shared the ViewpointChangedState with SceneView (#261)
changanxian Jan 2, 2024
7891a64
SceneView TimeExtent (#260)
changanxian Jan 3, 2024
9c3e44a
SceneView spatial reference changed (#258)
changanxian Jan 3, 2024
7e831b6
shared the ViewpointChangedState with SceneView (#257)
changanxian Jan 3, 2024
ccaf0bf
add layerViewStateChanged to SceneView (#262)
hud10837 Jan 3, 2024
f4b582d
The view property needs to be assigned in ViewProxy class (#264)
changanxian Jan 3, 2024
de95757
add cameraController oaram to sceneview (#265)
hud10837 Jan 5, 2024
8b5ea8b
add onDrawStatusChanged to SceneView (#266)
hud10837 Jan 8, 2024
1a11a41
add FieldOfView (#270)
puneet-pdx Jan 8, 2024
af69933
SceneView: add sunLighting and sunTime (#275)
hud10837 Jan 9, 2024
1c9ae9c
SceneView current viewpoint camera (#256)
changanxian Jan 9, 2024
ed0f739
add atmosphereEffect (#278)
puneet-pdx Jan 9, 2024
89f9448
Add funs for screen coordinate conversion (#272)
puneet-pdx Jan 9, 2024
bfb41ed
update doc for SceneView Suntime and SunLighting (#282)
puneet-pdx Jan 10, 2024
7ff9ec1
SceneView: AnalysisOverlayCollection (#269)
hud10837 Jan 11, 2024
86bd3c3
Add space effects on the scene view (#281)
changanxian Jan 11, 2024
2388a11
SceneView: ambient light color (#279)
hud10837 Jan 12, 2024
de70080
SceneView: add manual rendering funs to SceneViewProxy (#280)
hud10837 Jan 12, 2024
5dad991
SceneView: ImageOverlays (#274)
hud10837 Jan 17, 2024
6b5c713
SceneView: lighting options microapp (#286)
hud10837 Jan 19, 2024
b8f0658
bumping sdk to 4122 (#300)
sorenoid Jan 19, 2024
3d3a5ba
add maven publishing to geo-compose (#301)
sorenoid Jan 19, 2024
2f4d653
Scene view camera controller app (#288)
changanxian Jan 20, 2024
3c57d72
v next merge to geo compose (#303)
sorenoid Jan 20, 2024
9e58f74
Micro app - sceneview viewpoint navigation (#291)
puneet-pdx Jan 23, 2024
30ce4ef
Geo-Compose: Add module README (#294)
hud10837 Jan 23, 2024
b0bfd5a
Deprecate composable-map (#293)
puneet-pdx Jan 24, 2024
e4404f5
Add missing doc to geo-compose classes (#307)
hud10837 Jan 31, 2024
4fcec4d
added attribution bar changes (#309)
shubham7109 Feb 6, 2024
2766ca7
Geo-compose: Remove ViewpointChangedEvent (#310)
hud10837 Feb 9, 2024
e05b16d
Geo-compose: Remove ViewpointOperations (#316)
hud10837 Feb 14, 2024
4158f0f
Compose doc improvements (#315)
shubham7109 Feb 15, 2024
6c9a30e
Add @Stable annotation #319
shubham7109 Feb 15, 2024
659634d
Update SceneViewCameraController app to use SceneViewProxy (#325)
puneet-pdx Feb 16, 2024
4bf0d58
Merge v.next into feature-branches/geo-compose (#327)
puneet-pdx Feb 16, 2024
4759aae
Revisit GraphicsOverlayCollection, AnalysisOverlayCollection and Imag…
puneet-pdx Feb 22, 2024
1dea9bf
modify compass microapp to use mapViewProxy for viewpoints (#337)
hud10837 Feb 23, 2024
5ba7ea9
Composable MapView/SceneView: remember default parameters (#330)
hud10837 Feb 23, 2024
860accc
Update map and scene parameters to be non-nullable (#331)
shubham7109 Feb 27, 2024
871296d
SceneView: analysis overlay microapp (#306)
hud10837 Mar 5, 2024
a12e544
Composable GeoViews: Viewpoint Persistence (#343)
hud10837 Mar 8, 2024
10db942
Merge branch 'v.next' of github.com:ArcGIS/arcgis-maps-sdk-kotlin-too…
hud10837 Mar 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 1 addition & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,4 @@ ignoreBuildNumber=false
# these versions define the dependency of the ArcGIS Maps SDK for Kotlin dependency
# and are generally not overridden at the command line unless a special build is requested.
sdkVersionNumber=200.4.0
sdkBuildNumber=4085


sdkBuildNumber=4122
1 change: 0 additions & 1 deletion microapps/AuthenticationApp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ android {

dependencies {
implementation(project(":authentication"))
implementation(project(":composable-map"))
implementation(arcgis.mapsSdk)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.composeCore)
Expand Down
2 changes: 1 addition & 1 deletion microapps/CompassApp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class).all {

dependencies {
implementation(project(":compass"))
implementation(project(":composable-map"))
implementation(project(":geo-compose"))
implementation(arcgis.mapsSdk)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.composeCore)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package com.arcgismaps.toolkit.compassapp.screens

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.IntrinsicSize
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
Expand All @@ -26,40 +27,58 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableDoubleStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.lifecycle.viewmodel.compose.viewModel
import com.arcgismaps.mapping.ArcGISMap
import com.arcgismaps.mapping.BasemapStyle
import com.arcgismaps.mapping.Viewpoint
import com.arcgismaps.toolkit.compass.Compass
import com.arcgismaps.toolkit.composablemap.ComposableMap
import com.arcgismaps.toolkit.composablemap.DuplexFlow
import com.arcgismaps.toolkit.geocompose.MapView
import com.arcgismaps.toolkit.geocompose.MapViewProxy
import kotlinx.coroutines.launch

@Composable
fun MainScreen() {
// create an ArcGISMap with a Topographic basemap style
val map = ArcGISMap(BasemapStyle.ArcGISTopographic)
// instantiate a MapViewModel using the factory
val mapViewModel = viewModel<MapViewModel>(factory = MapViewModelFactory(map))
// hoist the mapRotation state
val mapRotation by mapViewModel.mapRotation.collectAsState(DuplexFlow.Type.Read)
// show a composable map using the mapViewModel
ComposableMap(
modifier = Modifier.fillMaxSize(),
mapInterface = mapViewModel
val arcGISMap by remember {
mutableStateOf(
ArcGISMap(BasemapStyle.ArcGISTopographic).apply {
// set the map's viewpoint to North America
initialViewpoint = Viewpoint(39.8, -98.6, 10e7)
}
)
}
var mapRotation by remember { mutableDoubleStateOf(0.0) }
val mapViewProxy = remember { MapViewProxy() }
// show composable MapView with compass
Box(
modifier = Modifier.fillMaxSize()
) {
Row(modifier = Modifier
.height(IntrinsicSize.Max)
.fillMaxWidth()
.padding(25.dp)) {
MapView(
arcGISMap,
modifier = Modifier.fillMaxSize(),
mapViewProxy = mapViewProxy,
onMapRotationChanged = { rotation -> mapRotation = rotation }
)
Row(
modifier = Modifier
.height(IntrinsicSize.Max)
.fillMaxWidth()
.padding(25.dp)
) {
val coroutineScope = rememberCoroutineScope()
// show the compass and pass the mapRotation state data
Compass(rotation = mapRotation) {
// reset the ComposableMap viewpoint rotation to point north using the mapViewModel
mapViewModel.setViewpointRotation(0.0)
// reset the Composable MapView viewpoint rotation to point north
coroutineScope.launch {
mapViewProxy.setViewpointRotation(0.0)
}
}
}
}
// set the composable map's viewpoint to North America
mapViewModel.setViewpoint(Viewpoint(39.8, -98.6, 10e7))
}

This file was deleted.

2 changes: 1 addition & 1 deletion microapps/FloorFilterApp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class).all {

dependencies {
implementation(project(":indoors"))
implementation(project(":composable-map"))
implementation(project(":geo-compose"))
implementation(arcgis.mapsSdk)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.composeCore)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,90 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.lifecycle.viewmodel.compose.viewModel
import com.arcgismaps.geometry.Envelope
import com.arcgismaps.geometry.Geometry
import com.arcgismaps.mapping.ArcGISMap
import com.arcgismaps.mapping.PortalItem
import com.arcgismaps.mapping.Viewpoint
import com.arcgismaps.portal.Portal
import com.arcgismaps.toolkit.composablemap.ComposableMap
import com.arcgismaps.toolkit.geocompose.MapView
import com.arcgismaps.toolkit.geocompose.MapViewProxy
import com.arcgismaps.toolkit.indoors.FloorFilter
import com.arcgismaps.toolkit.indoors.FloorFilterSelection
import com.arcgismaps.toolkit.indoors.FloorFilterState

@Composable
fun MainScreen() {
val portal = Portal("https://arcgis.com/")
val portalItem = PortalItem(portal, "b4b599a43a474d33946cf0df526426f5")
val floorAwareWebMap = ArcGISMap(portalItem)
val floorAwareWebMap by remember {
mutableStateOf(
ArcGISMap(
PortalItem(
Portal("https://arcgis.com/"),
"b4b599a43a474d33946cf0df526426f5"
)
)
)
}

val mapViewProxy = remember { MapViewProxy() }

val coroutineScope = rememberCoroutineScope()

// use default UI properties
val floorFilterState: FloorFilterState by remember {
mutableStateOf(FloorFilterState(
geoModel = floorAwareWebMap,
coroutineScope = coroutineScope
) { floorFilterSelection ->
when (floorFilterSelection.type) {
is FloorFilterSelection.Type.FloorSite -> {
val floorFilterSelectionType =
floorFilterSelection.type as FloorFilterSelection.Type.FloorSite
floorFilterSelectionType.site.geometry?.let {
mapViewProxy.setViewpoint(Viewpoint(getEnvelopeWithBuffer(it)))
}
}

is FloorFilterSelection.Type.FloorFacility -> {
val floorFilterSelectionType =
floorFilterSelection.type as FloorFilterSelection.Type.FloorFacility
floorFilterSelectionType.facility.geometry?.let {
mapViewProxy.setViewpoint(Viewpoint(getEnvelopeWithBuffer(it)))
}
}

val mapViewModel = viewModel<MapViewModel>(factory = MapViewModelFactory(floorAwareWebMap))
else -> {}
}
})
}

ComposableMap(
MapView(
floorAwareWebMap,
modifier = Modifier.fillMaxSize(),
mapInterface = mapViewModel
mapViewProxy = mapViewProxy
)
Box(
modifier = Modifier.fillMaxSize().padding(horizontal = 20.dp, vertical = 40.dp),
contentAlignment = Alignment.BottomStart
) {
Box(
modifier = Modifier.fillMaxSize().padding(horizontal = 20.dp, vertical = 40.dp),
contentAlignment = Alignment.BottomStart
) {
FloorFilter(floorFilterState = mapViewModel.floorFilterState)
}
FloorFilter(floorFilterState = floorFilterState)
}
}

/**
* Returns the envelope with an added buffer factor applied to the given Geometry's extent.
*
* @since 200.2.0
*/
private fun getEnvelopeWithBuffer(geometry: Geometry): Envelope {
val bufferFactor = 1.25
val envelope = geometry.extent
return Envelope(envelope.center, envelope.width * bufferFactor, envelope.height * bufferFactor)
}

This file was deleted.

15 changes: 15 additions & 0 deletions microapps/MapViewGeometryEditorApp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
12 changes: 12 additions & 0 deletions microapps/MapViewGeometryEditorApp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# MapView Geometry Editor Micro-app

This micro-app demonstrates the use of `GeometryEditor` and `GraphicsOverlay` with a composable `MapView`.

![Screenshot](screenshot.png)

## Usage

The application starts with a `GeometryEditor` set up and not enabled. Use the switch in the app bar to start/stop the geometry editor session.
Use the overflow action button in the app bar to choose between different options to undo, redo, or clear all `Graphics` from the `GraphicsOverlay`.

For more information on the composable `MapView` component and how it works, see it's [Readme](../../toolkit/geo-compose/README.md).
1 change: 1 addition & 0 deletions microapps/MapViewGeometryEditorApp/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
Loading