Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Curve on livemap #1021

Merged
merged 6 commits into from
Feb 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Cancel irrelevant changes (optimize imports).
  • Loading branch information
OLarionova-HORIS committed Feb 19, 2024
commit 6b780acbb622cb00c38c6b648173a6c243eb98c2
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ import org.jetbrains.letsPlot.livemap.WorldRectangle
import org.jetbrains.letsPlot.livemap.core.*
import org.jetbrains.letsPlot.livemap.core.Transforms
import org.jetbrains.letsPlot.livemap.mapengine.MapProjection
import org.jetbrains.letsPlot.commons.intern.typedGeometry.*
import kotlin.math.min

internal class MapProjectionBuilder(
private val geoProjection: GeoProjection,
private val mapRect: WorldRectangle
private val mapRect: org.jetbrains.letsPlot.livemap.WorldRectangle
) {
var reverseX = false
var reverseY = false
Expand Down Expand Up @@ -79,18 +80,18 @@ internal class MapProjectionBuilder(
val scaleY = if (reverseY) -scale else scale

val linearProjection =
Transforms.tuple<Geographic, World>(
Transforms.tuple<Geographic, org.jetbrains.letsPlot.livemap.World>(
linear(offsetX, scaleX),
linear(offsetY, scaleY)
)

val proj = composite(geoProjection, linearProjection)

return object : MapProjection {
override fun apply(v: LonLatPoint): WorldPoint? = proj.apply(v)
override fun invert(v: WorldPoint): LonLatPoint? = proj.invert(v)
override fun apply(v: LonLatPoint): org.jetbrains.letsPlot.livemap.WorldPoint? = proj.apply(v)
override fun invert(v: org.jetbrains.letsPlot.livemap.WorldPoint): LonLatPoint? = proj.invert(v)

override val mapRect: WorldRectangle
override val mapRect: org.jetbrains.letsPlot.livemap.WorldRectangle
get() = [email protected]
}
}
Expand Down