Blame view

src/main/kotlin/map/events/MarkerClickEvent.kt 693 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
27
28
29
30
31
32
33
  package fdit.leafletmap.events
  
  import java.util.*
  
  /**
   * Handles the MarkerClickEvent
   *
   * @author Niklas Kellner
   */
  interface MarkerClickEventListener {
      fun onMarkerClick(title: String)
  }
  
  internal class MarkerClickEventMaker {
      private val listeners = ArrayList<MarkerClickEventListener>()
      private var listenerSet = false
  
      fun addListener(toAdd: MarkerClickEventListener) {
          listeners.add(toAdd)
          listenerSet = true
      }
  
      fun MarkerClickEvent(title: String){
          // Notify everybody that may be interested.
          for (hl in listeners)
              hl.onMarkerClick(title)
      }
  
  
      fun isListenerSet(): Boolean{
          return listenerSet
      }
  }