Skip to content

Commit

Permalink
fix : fix show marker icon of interestPoint (liodali#229)
Browse files Browse the repository at this point in the history
* when interestPoint marker is not null should be override default icon
  • Loading branch information
liodali committed Mar 8, 2022
1 parent f9727e6 commit 81ccd53
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1049,13 +1049,12 @@ class FlutterOsmView(
if (clearPreviousRoad) {
folderRoad.items.clear()
}
var bitmapIconInterestPoints :Bitmap? = null
if (iconInterestPoints != null){
var bitmapIconInterestPoints: Bitmap? = null
if (iconInterestPoints != null) {
bitmapIconInterestPoints = getBitmap(bytes = iconInterestPoints!!)
}



val route = PolylineEncoder.decode(encodedWayPoints, 10, false)
val listInterestPoints = when (interestPointsEncoded != null) {
true -> PolylineEncoder.decode(interestPointsEncoded, 10, false)
Expand Down Expand Up @@ -1604,11 +1603,21 @@ class FlutterOsmView(
polyLine.outlinePaint.color = colorRoad ?: Color.GREEN

val iconsRoads = customRoadMarkerIcon
if (iconsRoads.isEmpty() && bitmapIcon != null) {
iconsRoads[Constants.STARTPOSITIONROAD] = bitmapIcon
iconsRoads[Constants.MIDDLEPOSITIONROAD] = bitmapIcon
iconsRoads[Constants.ENDPOSITIONROAD] = bitmapIcon

when {
(iconsRoads.isEmpty() && bitmapIcon != null) -> {
iconsRoads[Constants.STARTPOSITIONROAD] = bitmapIcon
iconsRoads[Constants.MIDDLEPOSITIONROAD] = bitmapIcon
iconsRoads[Constants.ENDPOSITIONROAD] = bitmapIcon
}
iconsRoads.isNotEmpty() && bitmapIcon != null -> {
iconsRoads[Constants.MIDDLEPOSITIONROAD] = bitmapIcon
if (!iconsRoads.containsKey(Constants.STARTPOSITIONROAD)) {
iconsRoads[Constants.STARTPOSITIONROAD] = bitmapIcon
}
if (!iconsRoads.containsKey(Constants.ENDPOSITIONROAD)) {
iconsRoads[Constants.ENDPOSITIONROAD] = bitmapIcon
}
}
}
val flutterRoad = FlutterRoad(
context,
Expand Down
4 changes: 2 additions & 2 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ packages:
path: "../flutter_osm_interface"
relative: true
source: path
version: "0.1.18"
version: "0.1.19"
flutter_osm_plugin:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "0.31.0"
version: "0.32.0"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
Expand Down
9 changes: 8 additions & 1 deletion flutter_osm_interface/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.11"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
meta:
dependency: transitive
description:
Expand Down Expand Up @@ -176,7 +183,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.3"
version: "0.4.8"
typed_data:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ packages:
path: flutter_osm_interface
relative: true
source: path
version: "0.1.18"
version: "0.1.19"
flutter_plugin_android_lifecycle:
dependency: "direct main"
description:
Expand Down

0 comments on commit 81ccd53

Please sign in to comment.