Blame view

src/main/kotlin/map/CircleMarkerGenerator.kt 430 Bytes
53f01ecc3   lsagona   display message o...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  package map
  
  import application.model.observableMessages
  
  fun clearMap(map: LeafletMapView) {
      map.clearAllLayer()
  }
  
  fun displayMessageOnMap(map: LeafletMapView) {
      observableMessages.vessels.forEach { (_, value) ->
          value.messages.forEach { (_, message) ->
              map.execScript("L.circleMarker([${message.latitude}, ${message.longitude}], {renderer: myRenderer, radius: 0.01}).addTo(myMap)")
          }
      }
  }