2020-10-15 20:12:15 -04:00
|
|
|
from kivy.app import App
|
|
|
|
from kivy.clock import Clock
|
2020-10-14 00:19:43 -04:00
|
|
|
from kivy_garden.mapview import MapMarkerPopup
|
2020-10-15 20:12:15 -04:00
|
|
|
|
2020-10-14 00:19:43 -04:00
|
|
|
from treepopupmenu import TreePopupMenu
|
|
|
|
|
|
|
|
class TreeMarker(MapMarkerPopup):
|
|
|
|
tree_data = []
|
|
|
|
|
|
|
|
def on_release(self):
|
2020-10-15 20:12:15 -04:00
|
|
|
# Center the map first
|
|
|
|
forestmap = App.get_running_app().root.ids.forestmapview
|
|
|
|
forestmap.center_on(self.lat, self.lon)
|
|
|
|
|
2020-10-14 00:19:43 -04:00
|
|
|
# Open the TreePopupMenu
|
|
|
|
menu = TreePopupMenu(self.tree_data)
|
|
|
|
menu.size_hint = [.8, .9]
|
2020-10-15 20:12:15 -04:00
|
|
|
Clock.schedule_once(menu.open, 1)
|
|
|
|
|
|
|
|
def update_forestmap_position(self):
|
|
|
|
print("] New Forest Map POSITION", self.lat, self.lon)
|