globalforest/treemarker.py

22 lines
643 B
Python
Raw Permalink Normal View History

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-14 00:19:43 -04:00
from treepopupmenu import TreePopupMenu
class TreeMarker(MapMarkerPopup):
tree_data = []
def on_release(self):
# 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]
Clock.schedule_once(menu.open, 1)
def update_forestmap_position(self):
print("] New Forest Map POSITION", self.lat, self.lon)