tweaking map scale/zoom
This commit is contained in:
parent
0f0d968a6a
commit
11cbb89821
4 changed files with 17 additions and 17 deletions
|
|
@ -15,7 +15,7 @@ is provided.
|
||||||
|
|
||||||
`./bin/kafka-streams-application-reset.sh --application-id kafkatorio-events-processor --input-topics factorio-server-log`
|
`./bin/kafka-streams-application-reset.sh --application-id kafkatorio-events-processor --input-topics factorio-server-log`
|
||||||
|
|
||||||
`:screen-fps=60.000000 :live-caching=300 :screen-width=1920 :screen-height=1080 :screen-top=20 :screen-left:20`
|
`:screen-fps=60.000000 :live-caching=300 :screen-width=1920 :screen-height=1080 :screen-top=100 :screen-left:20`
|
||||||
`:screen-fps=60.000000 :live-caching=300 --screen-width=1920 --screen-height=1080 :sout=#transcode{vcodec=h264,vb=0,scale=0,acodec=mpga,ab=128,channels=2,samplerate=44100}:file{dst=D:\\savedir.mp4} :sout-keep`
|
`:screen-fps=60.000000 :live-caching=300 --screen-width=1920 --screen-height=1080 :sout=#transcode{vcodec=h264,vb=0,scale=0,acodec=mpga,ab=128,channels=2,samplerate=44100}:file{dst=D:\\savedir.mp4} :sout-keep`
|
||||||
|
|
||||||
## todo
|
## todo
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,7 @@ export namespace Queue {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export function dequeueValues(targetWeight: uint = 50): EventData[] {
|
export function dequeueValues(targetWeight: uint = 50): EventData[] {
|
||||||
let values: EventData[] = []
|
let values: EventData[] = []
|
||||||
let weight: uint = 0
|
let weight: uint = 0
|
||||||
|
|
@ -107,18 +108,10 @@ export namespace Queue {
|
||||||
[key: string]: EventData | null;
|
[key: string]: EventData | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// interface PacketQueue<T> {
|
|
||||||
// enqueue(key: string, packet: T, weight: int): void
|
|
||||||
//
|
|
||||||
// dequeue(): WeightedPacket<T> | null
|
|
||||||
//
|
|
||||||
// dequeueValues(targetWeight: int): T[]
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
interface WeightedPacket {
|
interface WeightedPacket {
|
||||||
value: EventData,
|
value: EventData,
|
||||||
weight: int,
|
weight: int,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,4 +4,4 @@ import dev.adamko.kafkatorio.events.schema.PlayerData
|
||||||
import io.kvision.maps.Maps
|
import io.kvision.maps.Maps
|
||||||
import io.kvision.maps.externals.leaflet.geo.LatLng
|
import io.kvision.maps.externals.leaflet.geo.LatLng
|
||||||
|
|
||||||
fun PlayerData.latLng(): LatLng = Maps.L.latLng((position.y * -1) / 2 to position.x / 2)
|
fun PlayerData.latLng(): LatLng = Maps.L.latLng((position.y * -1) to position.x)
|
||||||
|
|
|
||||||
|
|
@ -27,22 +27,28 @@ fun createFactorioMap() = Maps {
|
||||||
configureLeafletMap {
|
configureLeafletMap {
|
||||||
setView(LatLng(0, 0), 1)
|
setView(LatLng(0, 0), 1)
|
||||||
|
|
||||||
// DefaultTileLayers.OpenStreetMap.addTo(this)
|
|
||||||
L.tileLayer(
|
L.tileLayer(
|
||||||
"""http://localhost:9073/tiles/s1/z{z}/x{x}/y{y}.png"""
|
"""http://localhost:9073/tiles/s1/z{z}/x{x}/y{y}.png"""
|
||||||
) {
|
) {
|
||||||
attribution = "kafkatorio"
|
attribution = "kafkatorio"
|
||||||
tileSize = 256
|
tileSize = 256
|
||||||
tms = true
|
tms = true
|
||||||
// minZoom = -2
|
|
||||||
// maxZoom = 1
|
minZoom = -2
|
||||||
maxNativeZoom = 4
|
maxZoom = 6
|
||||||
minNativeZoom = 0
|
|
||||||
|
// NOTE: offset the zoom, so 1 meter = 1 tile
|
||||||
|
maxNativeZoom = 3
|
||||||
|
minNativeZoom = -1
|
||||||
|
zoomOffset = 1
|
||||||
|
|
||||||
noWrap = true
|
noWrap = true
|
||||||
updateWhenIdle = true
|
updateWhenIdle = false
|
||||||
updateWhenZooming = true
|
updateWhenZooming = true
|
||||||
}.addTo(this)
|
}.addTo(this)
|
||||||
|
|
||||||
|
|
||||||
L.scale {
|
L.scale {
|
||||||
metric = true
|
metric = true
|
||||||
imperial = false
|
imperial = false
|
||||||
|
|
@ -50,6 +56,7 @@ fun createFactorioMap() = Maps {
|
||||||
|
|
||||||
|
|
||||||
options.crs = CRS.Simple
|
options.crs = CRS.Simple
|
||||||
|
options.zoomSnap = 0.1
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue