Blame view

src/main/kotlin/map/events/MapMoveEvent.kt 544 Bytes
53f01ecc3   lsagona   display message o...
1
  package map.events
d06a68ec6   lsagona   add Leaflet Kotli...
2

53f01ecc3   lsagona   display message o...
3
  import map.LatLong
d06a68ec6   lsagona   add Leaflet Kotli...
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  import java.util.*
  
  /**
   * Handles the MapMoveEvent
   *
   * @author Niklas Kellner
   */
  interface MapMoveEventListener {
      fun onMapMove(center: LatLong)
  }
  
  internal class MapMoveEventMaker {
      private val listeners = ArrayList<MapMoveEventListener>()
  
      fun addListener(toAdd: MapMoveEventListener) {
          listeners.add(toAdd)
      }
  
      fun MapMoveEvent(latLong: LatLong) {
          // Notify everybody that may be interested.
          for (hl in listeners)
              hl.onMapMove(latLong)
      }
  }