Skip to content

Commit

Permalink
fix bug in draw polyline android side #518
Browse files Browse the repository at this point in the history
  • Loading branch information
liodali committed Apr 5, 2024
1 parent 5dad876 commit b90eae8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1488,13 +1488,13 @@ class FlutterOsmView(
if (road.mRouteHigh.size > 2) {
routePointsEncoded = PolylineEncoder.encode(road.mRouteHigh, 10)
val polyLine = Polyline(map!!, false, false).apply {
this.setStyle(
setStyle(
borderColor = roadConfig.roadOption.roadBorderColor,
borderWidth = roadConfig.roadOption.roadBorderWidth,
color = roadConfig.roadOption.roadColor ?: Color.GREEN,
width = roadConfig.roadOption.roadWidth,
)
this.setPoints(RoadManager.buildRoadOverlay(road).actualPoints)
setPoints(RoadManager.buildRoadOverlay(road).actualPoints)

}
flutterRoad = createRoad(
Expand Down Expand Up @@ -1546,7 +1546,7 @@ class FlutterOsmView(
val encodedWayPoints = (args["road"] as String)
val roadColor = (args["roadColor"] as List<Int>).toRGB()
val roadWidth = (args["roadWidth"] as Double).toFloat()
val roadBorderWidth = (args["roadBorderWidth"] as Double).toFloat()
val roadBorderWidth = (args["roadBorderWidth"] as Double? ?: 0).toFloat()
val roadBorderColor = (args["roadBorderColor"] as List<Int>).toRGB()
val zoomToRegion = args["zoomIntoRegion"] as Boolean

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fun HashMap<String, Any>.toRoadConfig(): RoadConfig {
}
return RoadConfig(
roadID = roadId,
roadOption = this.toRoadOption(),
roadOption = toRoadOption(),
wayPoints = when {
this.containsKey("wayPoints") -> (this["wayPoints"] as List<HashMap<String, Double>>)
.map { g ->
Expand Down

0 comments on commit b90eae8

Please sign in to comment.