diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..7643783
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 0000000..79ee123
--- /dev/null
+++ b/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/deploymentTargetSelector.xml b/.idea/deploymentTargetSelector.xml
index b268ef3..4bba6b0 100644
--- a/.idea/deploymentTargetSelector.xml
+++ b/.idea/deploymentTargetSelector.xml
@@ -4,6 +4,14 @@
+
+
+
+
+
+
+
+
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index eb29722..db034f2 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -12,7 +12,7 @@ android {
defaultConfig {
applicationId = "com.example.snapandsolve"
- minSdk = 27
+ minSdk = 28
targetSdk = 36
versionCode = 1
versionName = "1.0"
@@ -68,4 +68,11 @@ dependencies {
debugImplementation(libs.androidx.compose.ui.test.manifest)
implementation("androidx.compose.material:material-icons-core")
implementation("androidx.compose.material:material-icons-extended")
+
+ // ArcGIS Maps for Kotlin - SDK dependency
+ implementation(libs.arcgis.maps.kotlin)
+ // Toolkit dependencies
+ implementation(platform(libs.arcgis.maps.kotlin.toolkit.bom))
+ implementation(libs.arcgis.maps.kotlin.toolkit.geoview.compose)
+ implementation(libs.arcgis.maps.kotlin.toolkit.authentication)
}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 1f25f57..c091ed7 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -4,6 +4,9 @@
+
+
+
Unit
) {
val mapViewModel = remember { MapViewModel(application) }
- // ViewModel für die Kamera-Funktionalität
val albumViewModel = remember { AlbumViewModel(Dispatchers.Default) }
+ // ArcGIS Map erstellen
+ val map = remember {
+ createMap() //Funktion zur Erstellung der Map
+ }
+
Box(modifier = modifier.fillMaxSize()) {
+ // HINTERGRUND: Die Map
+ MapView(
+ modifier = Modifier.fillMaxSize(),
+ arcGISMap = map
+ )
+
+ // VORDERGRUND: Das Overlay (wenn showReport = true)
if (showReport) {
ReportOverlay(
onCancel = onDismissReport,
@@ -333,4 +348,21 @@ fun ReportOverlay(
}
}
}
+
+
+}
+
+fun createMap(): ArcGISMap {
+
+ return ArcGISMap(BasemapStyle.ArcGISTopographic).apply {
+
+ initialViewpoint = Viewpoint(
+ 53.14,
+ 8.20,
+ 20000.0)
+
+
+
+ }
+
}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/snapandsolve/MapViewModel.kt b/app/src/main/java/com/example/snapandsolve/MapViewModel.kt
index 15aa574..772f85d 100644
--- a/app/src/main/java/com/example/snapandsolve/MapViewModel.kt
+++ b/app/src/main/java/com/example/snapandsolve/MapViewModel.kt
@@ -1,8 +1,64 @@
package com.example.snapandsolve
import android.app.Application
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.setValue
import androidx.lifecycle.AndroidViewModel
+import androidx.lifecycle.viewModelScope
+import com.arcgismaps.data.ArcGISFeature
+import com.arcgismaps.data.CodedValueDomain
+import com.arcgismaps.data.ServiceFeatureTable
+import com.arcgismaps.mapping.ArcGISMap
+import com.arcgismaps.mapping.BasemapStyle
+import com.arcgismaps.mapping.Viewpoint
+import com.arcgismaps.mapping.layers.FeatureLayer
+import com.arcgismaps.toolkit.geoviewcompose.MapViewProxy
+import kotlinx.coroutines.launch
class MapViewModel(application: Application ): AndroidViewModel(application) {
+ val map: ArcGISMap = ArcGISMap(BasemapStyle.OpenOsmStyle).apply {
+ initialViewpoint = Viewpoint(53.14, 8.20, 20000.0)
+ }
+
+ /*
+ ALLES UNTER DIESEM KOMMENTAR WIRD NICHT GENUTZT. Aber EVENTUELL nötig zum einbinden von
+ Layer und Features.
+ */
+ // Hold a reference to the selected feature.
+ var selectedFeature: ArcGISFeature? by mutableStateOf(null)
+ val mapViewProxy = MapViewProxy()
+
+ //var currentFeatureOperation by mutableStateOf(FeatureOperationType.CREATE)
+
+ lateinit var featureLayer: FeatureLayer
+
+ // Create a snackbar message to display the result of feature operations.
+ var snackBarMessage: String by mutableStateOf("")
+
+ lateinit var serviceFeatureTable: ServiceFeatureTable
+
+ var currentDamageType by mutableStateOf("")
+
+ // The list of damage types to update the feature attribute.
+ var damageTypeList: List = mutableListOf()
+
+ init {
+ viewModelScope.launch {
+ serviceFeatureTable = ServiceFeatureTable("https://services9.arcgis.com/UVxdrlZq3S3gqt7w/ArcGIS/rest/services/StrassenSchaeden/FeatureServer/0")
+ serviceFeatureTable.load().onSuccess {
+ // Get the field from the feature table that will be updated.
+ val typeDamageField = serviceFeatureTable.fields.first { it.name == "Typ" }
+ // Get the coded value domain for the field.
+ val attributeDomain = typeDamageField.domain as CodedValueDomain
+ // Add the damage types to the list.
+ attributeDomain.codedValues.forEach {
+ damageTypeList += it.name
+ }
+ }
+ featureLayer = FeatureLayer.createWithFeatureTable(serviceFeatureTable)
+ map.operationalLayers.add(featureLayer)
+ }
+ }
}
\ No newline at end of file
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 25884ad..b72ef65 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -9,6 +9,7 @@ lifecycleRuntimeKtx = "2.10.0"
activityCompose = "1.12.1"
composeBom = "2024.09.00"
material3 = "1.4.0"
+arcgisMapsKotlin = "200.8.0"
[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
@@ -26,6 +27,10 @@ androidx-compose-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-
androidx-compose-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" }
androidx-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "material3" }
+arcgis-maps-kotlin = { group = "com.esri", name = "arcgis-maps-kotlin", version.ref = "arcgisMapsKotlin" }
+arcgis-maps-kotlin-toolkit-bom = { group = "com.esri", name = "arcgis-maps-kotlin-toolkit-bom", version.ref = "arcgisMapsKotlin" }
+arcgis-maps-kotlin-toolkit-geoview-compose = { group = "com.esri", name = "arcgis-maps-kotlin-toolkit-geoview-compose" }
+arcgis-maps-kotlin-toolkit-authentication = { group = "com.esri", name = "arcgis-maps-kotlin-toolkit-authentication" }
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }