debug current zoom level

This commit is contained in:
Daniel afx 2020-10-14 15:29:53 +03:00
parent 915bc99603
commit 8d1994f365
5 changed files with 14 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

View file

Before

Width:  |  Height:  |  Size: 3 KiB

After

Width:  |  Height:  |  Size: 3 KiB

View file

@ -5,9 +5,11 @@
<ForestMapView>:
lat: 42.131331
lon: 24.747571
zoom: 15
zoom: 5
snap_to_zoom: False
on_zoom:
self.zoom = 5 if self.zoom < 5 else self.zoom
self.zoom = 7 if self.zoom < 7 else self.zoom
self.print_current_zoom(self.zoom)
on_lat:
self.start_get_fov_trees()
on_lon:

View file

@ -8,6 +8,9 @@ class ForestMapView(MapView):
get_trees_timer = None
tree_names = []
def print_current_zoom(self):
print("] Zoom level: " + zoom)
def start_get_fov_trees(self):
# After one second get the trees in field of view
try:
@ -28,8 +31,7 @@ class ForestMapView(MapView):
trees = app.cursor.fetchall()
for tree in trees:
name = tree[0]
print(tree)
print("Tree detected")
print("] Fountain detected: " + str(tree))
if name in self.tree_names:
continue
else:
@ -39,7 +41,7 @@ class ForestMapView(MapView):
# Create TreeMarker
name = tree[0]
lat, lon = tree[1], tree[2]
treemarker = TreeMarker(lat=lat, lon=lon, source='assets/images/marker.png')
treemarker = TreeMarker(lat=lat, lon=lon, source='assets/images/marker_tree.png')
treemarker.tree_data = treemarker
# Add TreeMarker to the map

View file

@ -21,6 +21,10 @@ from gpshelper import GpsHelper
from settings import SampleBoxLayout
from game import GameWidget
# MOTD
motd = """]
] GlobalForest 0.1 by afx"""
Builder.load_string("""
<ScreenOne>:
BoxLayout:
@ -59,6 +63,7 @@ class MainApp(MDApp):
#return SampleBoxLayout()
def on_start(self):
print(motd)
connection = None
cursor = None