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 2f3905eb..cbc0aba3 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 @@ -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( @@ -1546,7 +1546,7 @@ class FlutterOsmView( val encodedWayPoints = (args["road"] as String) val roadColor = (args["roadColor"] as List).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).toRGB() val zoomToRegion = args["zoomIntoRegion"] as Boolean diff --git a/android/src/main/kotlin/hamza/dali/flutter_osm_plugin/models/RoadConfig.kt b/android/src/main/kotlin/hamza/dali/flutter_osm_plugin/models/RoadConfig.kt index 60f76f25..5e03524d 100644 --- a/android/src/main/kotlin/hamza/dali/flutter_osm_plugin/models/RoadConfig.kt +++ b/android/src/main/kotlin/hamza/dali/flutter_osm_plugin/models/RoadConfig.kt @@ -53,7 +53,7 @@ fun HashMap.toRoadConfig(): RoadConfig { } return RoadConfig( roadID = roadId, - roadOption = this.toRoadOption(), + roadOption = toRoadOption(), wayPoints = when { this.containsKey("wayPoints") -> (this["wayPoints"] as List>) .map { g ->