Blame view
src/main/kotlin/map/CircleMarkerGenerator.kt
609 Bytes
53f01ecc3 display message o... |
1 2 3 |
package map import application.model.observableMessages |
43370abfe clear map canvas ... |
4 5 6 7 8 |
fun clearMapCanvas(map: LeafletMapView) { map.execScript(""" |myRenderer.removeFrom(myMap) |var myRenderer = L.canvas({ padding: 0.5 }); """.trimMargin()) |
53f01ecc3 display message o... |
9 10 11 |
} fun displayMessageOnMap(map: LeafletMapView) { |
43370abfe clear map canvas ... |
12 |
clearMapCanvas(map) |
53f01ecc3 display message o... |
13 14 |
observableMessages.vessels.forEach { (_, value) -> value.messages.forEach { (_, message) -> |
52321443a different color f... |
15 |
map.execScript("L.circleMarker([${message.latitude}, ${message.longitude}], {renderer: myRenderer, radius: 0.01, color: '#${message.getHexColor()}'}).addTo(myMap)") |
53f01ecc3 display message o... |
16 17 18 |
} } } |