Skip to content

Commit

Permalink
fix issue in set staticMarkers icon #575
Browse files Browse the repository at this point in the history
  • Loading branch information
liodali committed Nov 30, 2024
1 parent 0013f27 commit 9f7782d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
1 change: 1 addition & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
.DS_Store
/build
/captures
.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
7 changes: 6 additions & 1 deletion example/android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@ gradle-wrapper.jar
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
/app

# Remember to never publicly share your keystore.
# See https://flutter.dev/to/reference-keystore
key.properties
**/*.keystore
**/*.jks
15 changes: 7 additions & 8 deletions lib/src/controller/osm/osm_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9f7782d

Please sign in to comment.