Skip to content

Commit

Permalink
Fix web app build
Browse files Browse the repository at this point in the history
Update layer ordering of route and stops
  • Loading branch information
dellisd committed Mar 30, 2024
1 parent 49330fb commit c7d7211
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
8 changes: 8 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -23,3 +27,7 @@ spotless {
endWithNewline()
}
}

plugins.withType(YarnPlugin::class.java) {
the<YarnRootExtension>().yarnLockMismatchReport = YarnLockMismatchReport.WARNING
}
2 changes: 1 addition & 1 deletion web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 10 additions & 10 deletions web/src/jsMain/kotlin/ca/derekellis/reroute/map/MapView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,16 @@ private fun MapContent(
}
},
) {
val routeGeojson = remember(routeFeatures) {
JSON.parse<GeoJsonObject>(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))
Expand All @@ -96,16 +106,6 @@ private fun MapContent(
)
}
}

val routeGeojson = remember(routeFeatures) {
JSON.parse<GeoJsonObject>(FeatureCollection(routeFeatures.toList()).json())
}
GeoJsonSource("routes", routeGeojson) {
LineLayer("route-lines") {
lineWidth(5.0)
lineColor(get("color"))
}
}
}
}
}

0 comments on commit c7d7211

Please sign in to comment.