fixing deserialisation, and options
This commit is contained in:
parent
f108431033
commit
f38143dee9
3 changed files with 12 additions and 11 deletions
|
|
@ -1,9 +1,7 @@
|
|||
package dev.adamko.kafkatorio.webmap
|
||||
|
||||
import dev.adamko.kafkatorio.events.schema.Colour
|
||||
import dev.adamko.kafkatorio.events.schema.PlayerData
|
||||
import io.kvision.maps.externals.leaflet.geo.LatLng
|
||||
import io.kvision.maps.Maps
|
||||
import kotlin.math.roundToInt
|
||||
import io.kvision.maps.externals.leaflet.geo.LatLng
|
||||
|
||||
fun PlayerData.latLng(): LatLng = Maps.L.latLng((position.y * -1) to position.x)
|
||||
fun PlayerData.latLng(): LatLng = Maps.L.latLng((position.y * -1) / 2 to position.x / 2)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package dev.adamko.kafkatorio.webmap
|
||||
|
||||
import dev.adamko.kafkatorio.events.schema.jsonMapperKafkatorio
|
||||
import kotlinx.serialization.json.Json
|
||||
|
||||
val jsonMapper = Json {
|
||||
prettyPrint = true
|
||||
serializersModule = jsonMapperKafkatorio.serializersModule
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
package dev.adamko.kafkatorio.webmap
|
||||
|
||||
import io.kvision.maps.DefaultTileLayers
|
||||
import io.kvision.maps.externals.leaflet.geo.CRS
|
||||
import io.kvision.maps.externals.leaflet.geo.LatLng
|
||||
import io.kvision.maps.Maps
|
||||
import io.kvision.maps.Maps.Companion.L
|
||||
import io.kvision.maps.externals.leaflet.geo.CRS
|
||||
import io.kvision.maps.externals.leaflet.geo.LatLng
|
||||
import io.kvision.utils.px
|
||||
|
||||
//
|
||||
|
|
@ -39,15 +38,17 @@ fun createFactorioMap() = Maps {
|
|||
// maxZoom = 1
|
||||
maxNativeZoom = 1
|
||||
minNativeZoom = 1
|
||||
noWrap = true
|
||||
updateWhenIdle = true
|
||||
updateWhenZooming = true
|
||||
}.addTo(this)
|
||||
|
||||
L.scale {
|
||||
metric = true
|
||||
}.addTo(this)
|
||||
|
||||
}
|
||||
|
||||
with(options) {
|
||||
crs = CRS.Simple
|
||||
}
|
||||
options.crs = CRS.Simple
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue