- Bewertungsystem

- Filtern nach Schäden
- Docs Ordner mit Markdown dummies gefüllt.
This commit is contained in:
2026-01-21 21:37:58 +01:00
parent 33e95641d0
commit 05426b687c
21 changed files with 642 additions and 29 deletions

View File

@@ -33,11 +33,21 @@ import java.io.ByteArrayOutputStream
class MapViewModel(application: Application) : AndroidViewModel(application) {
companion object {
// Zentrale Definition der Schadenstypen
val DAMAGE_TYPES = listOf(
"Straße",
"Gehweg",
"Fahrradweg",
"Beleuchtung",
"Sonstiges"
)
}
val map: ArcGISMap = ArcGISMap(BasemapStyle.OpenOsmStyle).apply {
initialViewpoint = Viewpoint(53.14, 8.20, 20000.0)
}
var selectedOperation by mutableStateOf(FeatureOperationType.DEFAULT)
private set
var reopenReport by mutableStateOf(false)
private set
var showFeatureInfo by mutableStateOf(false)
@@ -64,7 +74,7 @@ class MapViewModel(application: Application) : AndroidViewModel(application) {
init {
tempOverlay.graphics.add(pointGraphic)
viewModelScope.launch {
serviceFeatureTable = ServiceFeatureTable("https://services9.arcgis.com/UVxdrlZq3S3gqt7w/arcgis/rest/services/251120_StrassenSchaeden/FeatureServer/0")
serviceFeatureTable = ServiceFeatureTable("https://services9.arcgis.com/UVxdrlZq3S3gqt7w/arcgis/rest/services/si_StrassenSchaeden/FeatureServer/0")
serviceFeatureTable.load().onSuccess {
val typeDamageField = serviceFeatureTable.fields.firstOrNull { it.name == "Typ" }
val attributeDomain = typeDamageField?.domain as? CodedValueDomain
@@ -175,7 +185,6 @@ class MapViewModel(application: Application) : AndroidViewModel(application) {
}
fun onTap(singleTapConfirmedEvent: SingleTapConfirmedEvent) {
if (featureLayer.loadStatus.value != LoadStatus.Loaded) {
snackBarMessage = "Layer not loaded!"
return
@@ -187,7 +196,7 @@ class MapViewModel(application: Application) : AndroidViewModel(application) {
FeatureOperationType.UPDATE_ATTRIBUTE -> selectFeatureForAttributeEditAt(singleTapConfirmedEvent.screenCoordinate)
FeatureOperationType.UPDATE_GEOMETRY -> updateFeatureGeometryAt(singleTapConfirmedEvent.screenCoordinate)
FeatureOperationType.PICK_REPORT_LOCATION -> pickReportLocation(singleTapConfirmedEvent.screenCoordinate)
else -> {}
// RATE_FEATURE wird nicht mehr gebraucht - wird im DEFAULT mit behandelt!
}
}
@@ -250,7 +259,7 @@ class MapViewModel(application: Application) : AndroidViewModel(application) {
}
}
}
// When a feature is selected, update its geometry to the tapped location.
else -> {
mapViewProxy.screenToLocationOrNull(screenCoordinate)?.let { mapPoint ->
// Normalize the point - needed when the tapped location is over the international date line.