From 9f7782dd56bcbad2a7973cac12c2eb12974c6c46 Mon Sep 17 00:00:00 2001 From: liodali <16631886+liodali@users.noreply.github.com> Date: Sat, 30 Nov 2024 10:08:10 +0100 Subject: [PATCH] fix issue in set staticMarkers icon #575 --- android/.gitignore | 1 + .../dali/flutter_osm_plugin/FlutterOsmView.kt | 10 ++++------ example/android/.gitignore | 7 ++++++- lib/src/controller/osm/osm_controller.dart | 15 +++++++-------- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/android/.gitignore b/android/.gitignore index c6cbe562..161bdcda 100644 --- a/android/.gitignore +++ b/android/.gitignore @@ -6,3 +6,4 @@ .DS_Store /build /captures +.cxx diff --git a/android/src/main/kotlin/hamza/dali/flutter_osm_plugin/FlutterOsmView.kt b/android/src/main/kotlin/hamza/dali/flutter_osm_plugin/FlutterOsmView.kt index 65620e99..8ea48d6a 100644 --- a/android/src/main/kotlin/hamza/dali/flutter_osm_plugin/FlutterOsmView.kt +++ b/android/src/main/kotlin/hamza/dali/flutter_osm_plugin/FlutterOsmView.kt @@ -1384,12 +1384,10 @@ class FlutterOsmView( val refresh = hashMap["refresh"] as Boolean staticMarkerIcon[key] = bitmap - scope?.launch { - if (staticPoints.containsKey(key) && refresh) { - showStaticPosition( - key, - ) - } + if (staticPoints.containsKey(key) && refresh) { + showStaticPosition( + key, + ) } result.success(null) } catch (e: java.lang.Exception) { diff --git a/example/android/.gitignore b/example/android/.gitignore index 0c39c2d1..55afd919 100644 --- a/example/android/.gitignore +++ b/example/android/.gitignore @@ -5,4 +5,9 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java -/app \ No newline at end of file + +# Remember to never publicly share your keystore. +# See https://flutter.dev/to/reference-keystore +key.properties +**/*.keystore +**/*.jks diff --git a/lib/src/controller/osm/osm_controller.dart b/lib/src/controller/osm/osm_controller.dart index dc57dd2a..51983c1b 100644 --- a/lib/src/controller/osm/osm_controller.dart +++ b/lib/src/controller/osm/osm_controller.dart @@ -355,14 +355,13 @@ final class MobileOSMController extends IBaseOSMController { bool refresh = false, }) async { _osmFlutterState.widget.dynamicMarkerWidgetNotifier.value = markerIcon; - await Future.delayed(duration, () async { - await osmPlatform.customMarkerStaticPosition( - _idMap, - _osmFlutterState.dynamicMarkerKey, - id, - refresh: refresh, - ); - }); + await osmPlatform.customMarkerStaticPosition( + _idMap, + _osmFlutterState.dynamicMarkerKey, + id, + refresh: refresh, + ); + await Future.delayed(duration); } /// change static position in runtime