diff --git a/.space.kts b/.space.kts index bd47550..c5dd962 100644 --- a/.space.kts +++ b/.space.kts @@ -9,17 +9,17 @@ job("Publish") { gitPush { enabled = false } } container("spc.registry.jetbrains.space/p/sci/containers/kotlin-ci:1.0.3") { - env["SPACE_USER"] = Secrets("space_user") - env["SPACE_TOKEN"] = Secrets("space_token") + env["SPACE_USER"] = "{{ project:space_user }}" + env["SPACE_TOKEN"] = "{{ project:space_token }}" kotlinScript { api -> val spaceUser = System.getenv("SPACE_USER") val spaceToken = System.getenv("SPACE_TOKEN") - // write version to the build directory + // write the version to the build directory api.gradlew("version") - //read version from build file + //read the version from build file val version = java.nio.file.Path.of("build/project-version.txt").readText() val revisionSuffix = if (version.endsWith("SNAPSHOT")) { @@ -32,7 +32,7 @@ job("Publish") { project = api.projectIdentifier(), targetIdentifier = TargetIdentifier.Key("maps-kt"), version = version+revisionSuffix, - // automatically update deployment status based on a status of a job + // automatically update deployment status based on the status of a job syncWithAutomationJob = true ) api.gradlew( diff --git a/build.gradle.kts b/build.gradle.kts index 2ee9a4d..6507ca2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,11 +6,11 @@ plugins { id("space.kscience.gradle.project") } -val kmathVersion: String by extra("0.3.1-dev-RC") +val kmathVersion: String by extra("0.3.1") allprojects { group = "center.sciprog" - version = "0.2.2" + version = "0.2.3-dev-1" repositories { mavenLocal() diff --git a/demo/maps/src/jvmMain/kotlin/Main.kt b/demo/maps/src/jvmMain/kotlin/Main.kt index 235bcac..14d5a67 100644 --- a/demo/maps/src/jvmMain/kotlin/Main.kt +++ b/demo/maps/src/jvmMain/kotlin/Main.kt @@ -55,7 +55,6 @@ fun App() { val centerCoordinates = MutableStateFlow(null) - val pointOne = 55.568548 to 37.568604 val pointTwo = 55.929444 to 37.518434 // val pointThree = 60.929444 to 37.518434 @@ -90,6 +89,7 @@ fun App() { println("line 3 clicked") } + multiLine( points = listOf( 55.742465 to 37.615812, @@ -101,6 +101,15 @@ fun App() { ), ) + points( + points = listOf( + 55.744 to 38.614, + 55.8 to 38.5, + 56.0 to 38.5, + ) + ).pointSize(5f) + + //remember feature ID val circleId = circle( centerCoordinates = pointTwo, @@ -120,9 +129,11 @@ fun App() { arc(pointOne, 10.0.kilometers, (PI / 4).radians, -Angle.pi / 2) + line(pointOne, pointTwo, id = "line") text(pointOne, "Home", font = { size = 32f }) + pixelMap( space.Rectangle( Gmc(latitude = 55.58461879539754.degrees, longitude = 37.8746197303493.degrees), @@ -132,8 +143,8 @@ fun App() { 0.005.degrees ) { gmc -> Color( - red = ((gmc.latitude + Angle.piDiv2).degrees*10 % 1f).toFloat(), - green = ((gmc.longitude + Angle.pi).degrees*10 % 1f).toFloat(), + red = ((gmc.latitude + Angle.piDiv2).degrees * 10 % 1f).toFloat(), + green = ((gmc.longitude + Angle.pi).degrees * 10 % 1f).toFloat(), blue = 0f ).copy(alpha = 0.3f) } diff --git a/maps-kt-features/src/commonMain/kotlin/center/sciprog/maps/features/mapFeatureAttributes.kt b/maps-kt-features/src/commonMain/kotlin/center/sciprog/maps/features/mapFeatureAttributes.kt index 9b85e82..a824a50 100644 --- a/maps-kt-features/src/commonMain/kotlin/center/sciprog/maps/features/mapFeatureAttributes.kt +++ b/maps-kt-features/src/commonMain/kotlin/center/sciprog/maps/features/mapFeatureAttributes.kt @@ -169,4 +169,7 @@ public fun FeatureRef>.pathEffect(effect: Pat public object StrokeAttribute : Attribute public fun > FeatureRef.stroke(width: Float): FeatureRef = + modifyAttribute(StrokeAttribute, width) + +public fun > FeatureRef.pointSize(width: Float): FeatureRef = modifyAttribute(StrokeAttribute, width) \ No newline at end of file diff --git a/maps-kt-features/src/jvmMain/kotlin/center/sciprog/maps/features/drawFeature.kt b/maps-kt-features/src/jvmMain/kotlin/center/sciprog/maps/features/drawFeature.kt index 8948f79..f9c9d73 100644 --- a/maps-kt-features/src/jvmMain/kotlin/center/sciprog/maps/features/drawFeature.kt +++ b/maps-kt-features/src/jvmMain/kotlin/center/sciprog/maps/features/drawFeature.kt @@ -3,7 +3,10 @@ package center.sciprog.maps.features import androidx.compose.ui.geometry.Offset import androidx.compose.ui.geometry.Size import androidx.compose.ui.graphics.* -import androidx.compose.ui.graphics.drawscope.* +import androidx.compose.ui.graphics.drawscope.DrawScope +import androidx.compose.ui.graphics.drawscope.Stroke +import androidx.compose.ui.graphics.drawscope.drawIntoCanvas +import androidx.compose.ui.graphics.drawscope.translate import androidx.compose.ui.graphics.painter.Painter import center.sciprog.attributes.plus import org.jetbrains.skia.Font @@ -121,7 +124,7 @@ public fun DrawScope.drawFeature( drawPoints( points = points, color = color, - strokeWidth = feature.attributes[StrokeAttribute] ?: Stroke.HairlineWidth, + strokeWidth = feature.attributes[StrokeAttribute] ?: 5f, pointMode = PointMode.Points, pathEffect = feature.attributes[PathEffectAttribute], alpha = alpha