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

dev branch #66

Merged
merged 15 commits into from
Dec 18, 2019
Merged
Show file tree
Hide file tree
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
Fixed blur on vector tiles.
  • Loading branch information
ISeleznev-HORIS authored and IKupriyanov-HORIS committed Dec 18, 2019
commit ac23b8e014d1a2b3e071be92a64e67e332776d84
Original file line number Diff line number Diff line change
Expand Up @@ -21,131 +21,139 @@ class FeaturesDemoModel(dimension: DoubleVector): DemoModelBase(dimension) {
return basicLiveMap {
layers {

points {
point {
mapId = "Russia"

shape = 21
radius = 10.0
fillColor = Color.GREEN
}

point {
coord(10.0, 10.0)

shape = 21
radius = 10.0
fillColor = Color.LIGHT_CYAN
}

point {
coord(0.0, 0.0)

shape = 21
radius = 10.0
fillColor = Color.MAGENTA
animation = 2
}
}
// points {
// point {
// mapId = "Texas"
//
// shape = 21
// radius = 10.0
// fillColor = Color.GREEN
// }
//
// point {
// mapId = "FL"
//
// shape = 21
// radius = 10.0
// fillColor = Color.GREEN
// }
//
// point {
// coord(10.0, 10.0)
//
// shape = 21
// radius = 10.0
// fillColor = Color.LIGHT_CYAN
// }
//
// point {
// coord(0.0, 0.0)
//
// shape = 21
// radius = 10.0
// fillColor = Color.MAGENTA
// animation = 2
// }
// }

paths {
path {
geometry(listOf(BOSTON, SPB).map(GeoObject::geoCoord), isGeodesic = false)
geometry(listOf(MOSCOW, SPB).map(GeoObject::geoCoord), isGeodesic = false)

strokeWidth = 1.0
}

path {
geometry(listOf(BOSTON, FRISCO).map(GeoObject::geoCoord), isGeodesic = true)

strokeWidth = 1.0
animation = 2
}
}

polygons {
polygon {
geometry(listOf(BOSTON, SPB, MOSCOW).map(GeoObject::geoCoord), isGeodesic = false)

fillColor = Color.LIGHT_CYAN
}

polygon {
mapId = "Canada"
fillColor = Color.GREEN
}
}

hLines {
line {
coord(MOSCOW)
}

line {
mapId = "Vatican"
strokeColor = Color.PINK
strokeWidth = 3.0
}
}

vLines {
line {
coord(BOSTON)
}
}

bars {
bar {
indices = listOf(0, 1, 2)
coord(BOSTON)

radius = 50.0
values = listOf(3.0, 0.0, 2.0)
colors = listOf(Color.DARK_GREEN, Color.ORANGE, Color.DARK_MAGENTA)
}

bar {
mapId = "Finland"

indices = listOf(3, 4, 5)

radius = 50.0
values = listOf(-2.0, -1.0, 4.0)
colors = listOf(Color.DARK_GREEN, Color.ORANGE, Color.DARK_MAGENTA)
}
}

pies {
pie {
indices = listOf(0, 1, 2)
mapId = "Sweden"
radius = 20.0
values = listOf(-2.0, 5.0, 1.0)
colors = listOf(Color.DARK_GREEN, Color.ORANGE, Color.DARK_MAGENTA)
}

pie {
indices = listOf(0, 1, 2)
coord(NEW_YORK)
radius = 20.0
values = listOf(3.0, 1.0, 2.0)
colors = listOf(Color.DARK_GREEN, Color.ORANGE, Color.DARK_MAGENTA)
}
}

texts {
text {
label = "POLAND"
mapId = "Poland"
size = 25.0
}

text {
label = "KIRIBATI"
coord(-157.3662, 1.8351)
size = 50.0
}
// path {
// geometry(listOf(BOSTON, FRISCO).map(GeoObject::geoCoord), isGeodesic = true)
//
// strokeWidth = 1.0
// animation = 2
// }
}
//
// polygons {
// polygon {
// geometry(listOf(BOSTON, SPB, MOSCOW).map(GeoObject::geoCoord), isGeodesic = false)
//
// fillColor = Color.LIGHT_CYAN
// }
//
// polygon {
// mapId = "Canada"
// fillColor = Color.GREEN
// }
// }
//
// hLines {
// line {
// coord(MOSCOW)
// }
//
// line {
// mapId = "Vatican"
// strokeColor = Color.PINK
// strokeWidth = 3.0
// }
// }
//
// vLines {
// line {
// coord(BOSTON)
// }
// }
//
// bars {
// bar {
// indices = listOf(0, 1, 2)
// coord(BOSTON)
//
// radius = 50.0
// values = listOf(3.0, 0.0, 2.0)
// colors = listOf(Color.DARK_GREEN, Color.ORANGE, Color.DARK_MAGENTA)
// }
//
// bar {
// mapId = "Finland"
//
// indices = listOf(3, 4, 5)
//
// radius = 50.0
// values = listOf(-2.0, -1.0, 4.0)
// colors = listOf(Color.DARK_GREEN, Color.ORANGE, Color.DARK_MAGENTA)
// }
// }
//
// pies {
// pie {
// indices = listOf(0, 1, 2)
// mapId = "Sweden"
// radius = 20.0
// values = listOf(-2.0, 5.0, 1.0)
// colors = listOf(Color.DARK_GREEN, Color.ORANGE, Color.DARK_MAGENTA)
// }
//
// pie {
// indices = listOf(0, 1, 2)
// coord(NEW_YORK)
// radius = 20.0
// values = listOf(3.0, 1.0, 2.0)
// colors = listOf(Color.DARK_GREEN, Color.ORANGE, Color.DARK_MAGENTA)
// }
// }
//
// texts {
// text {
// label = "POLAND"
// mapId = "Poland"
// size = 25.0
// }
//
// text {
// label = "KIRIBATI"
// coord(-157.3662, 1.8351)
// size = 50.0
// }
// }
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import jetbrains.datalore.vis.canvas.Context2d
import jetbrains.livemap.camera.Viewport
import jetbrains.livemap.core.rendering.primitives.RenderObject
import jetbrains.livemap.projections.ClientPoint
import kotlin.math.floor

open class MapRenderContext internal constructor(
open val viewport: Viewport,
Expand All @@ -27,7 +28,7 @@ open class MapRenderContext internal constructor(

fun draw(context: Context2d, x: Double, y: Double, renderObject: RenderObject) {
context.save()
context.translate(x, y)
context.translate(floor(x), floor(y))
renderObject.render(context)
context.restore()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ internal class TileDataRendererImpl(
layerKind: CellLayerKind,
zoom: Int
): Collection<() -> Unit> {
val mapConfig = myMapConfigSupplier()
if (mapConfig == null) {
return emptyList()
}
val mapConfig = myMapConfigSupplier() ?: return emptyList()

val tasks = ArrayList<() -> Unit>()
val labelBounds = ArrayList<DoubleRectangle>()
Expand Down