diff --git a/build.gradle.kts b/build.gradle.kts index 9847006..eab2179 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,7 @@ +import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnLockMismatchReport +import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin +import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension + plugins { alias(libs.plugins.kotlin.multiplatform) apply false alias(libs.plugins.kotlin.jvm) apply false @@ -23,3 +27,7 @@ spotless { endWithNewline() } } + +plugins.withType(YarnPlugin::class.java) { + the().yarnLockMismatchReport = YarnLockMismatchReport.WARNING +} diff --git a/web/Dockerfile b/web/Dockerfile index f5cfd81..f16d38b 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -3,7 +3,7 @@ FROM gradle:jdk17 AS builder COPY . /home/gradle/src WORKDIR /home/gradle/src -RUN gradle :web:jsBrowserWebpack +RUN gradle :web:jsBrowserDistribution FROM nginx:1.23.0 diff --git a/web/src/jsMain/kotlin/ca/derekellis/reroute/map/MapView.kt b/web/src/jsMain/kotlin/ca/derekellis/reroute/map/MapView.kt index 0a48037..481030b 100644 --- a/web/src/jsMain/kotlin/ca/derekellis/reroute/map/MapView.kt +++ b/web/src/jsMain/kotlin/ca/derekellis/reroute/map/MapView.kt @@ -83,6 +83,16 @@ private fun MapContent( } }, ) { + val routeGeojson = remember(routeFeatures) { + JSON.parse(FeatureCollection(routeFeatures.toList()).json()) + } + GeoJsonSource("routes", routeGeojson) { + LineLayer("route-lines") { + lineWidth(5.0) + lineColor(get("color")) + } + } + GeoJsonSource("stops", url = "/api/data/geojson") { CircleLayer("stop-circles") { circleColor(hsl(4.1, 89.6, 58.4)) @@ -96,16 +106,6 @@ private fun MapContent( ) } } - - val routeGeojson = remember(routeFeatures) { - JSON.parse(FeatureCollection(routeFeatures.toList()).json()) - } - GeoJsonSource("routes", routeGeojson) { - LineLayer("route-lines") { - lineWidth(5.0) - lineColor(get("color")) - } - } } } }