Blame view

src/main/kotlin/map/events/MapClickEvent.kt 574 Bytes
d06a68ec6   lsagona   add Leaflet Kotli...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
  package fdit.leafletmap.events
  
  import fdit.leafletmap.LatLong
  import java.util.*
  
  /**
   * Handles the MapClickEvent
   * @author Niklas Kellner
   */
  interface MapClickEventListener {
      fun onMapClick(latLong: LatLong)
  }
  
  internal class MapClickEventMaker {
      private val listeners = ArrayList<MapClickEventListener>()
  
      fun addListener(toAdd: MapClickEventListener) {
          listeners.add(toAdd)
      }
  
      fun MapClickEvent(latLong: LatLong) {
          // Notify everybody that may be interested.
          for (hl in listeners)
              hl.onMapClick(latLong)
      }
  }