migrate from mapview flower to mapview package
This commit is contained in:
parent
d5e101e8bc
commit
f534b552f7
5 changed files with 8 additions and 7 deletions
|
@ -36,14 +36,14 @@ version = 0.1
|
||||||
|
|
||||||
# (list) Application requirements
|
# (list) Application requirements
|
||||||
# comma separated e.g. requirements = sqlite3,kivy
|
# comma separated e.g. requirements = sqlite3,kivy
|
||||||
requirements = python3,kivy,kivymd
|
requirements = python3,kivy,kivymd,mapview
|
||||||
|
|
||||||
# (str) Custom source folders for requirements
|
# (str) Custom source folders for requirements
|
||||||
# Sets custom source for any requirements with recipes
|
# Sets custom source for any requirements with recipes
|
||||||
# requirements.source.kivy = ../../kivy
|
# requirements.source.kivy = ../../kivy
|
||||||
|
|
||||||
# (list) Garden requirements
|
# (list) Garden requirements
|
||||||
#garden_requirements =
|
#garden_requirements =
|
||||||
|
|
||||||
# (str) Presplash of the application
|
# (str) Presplash of the application
|
||||||
#presplash.filename = %(source.dir)s/data/presplash.png
|
#presplash.filename = %(source.dir)s/data/presplash.png
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
#:import MapView kivy.garden.mapview.MapView
|
#:import MapView kivy_garden.mapview.MapView
|
||||||
#:import GpsBlinker gpsblinker.GpsBlinker
|
#:import GpsBlinker gpsblinker.GpsBlinker
|
||||||
#:include gpsblinker.kv
|
#:include gpsblinker.kv
|
||||||
|
|
||||||
<ForestMapView>:
|
<ForestMapView>:
|
||||||
lat: 42.131331
|
lat: 42.131331
|
||||||
lon: 24.747571
|
lon: 24.747571
|
||||||
zoom: 18
|
zoom: 15
|
||||||
on_zoom:
|
on_zoom:
|
||||||
self.zoom = 15 if self.zoom < 15 else self.zoom
|
self.zoom = 15 if self.zoom < 15 else self.zoom
|
||||||
on_lat:
|
on_lat:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from kivy.garden.mapview import MapView
|
from kivy_garden.mapview import MapView
|
||||||
from kivy.clock import Clock
|
from kivy.clock import Clock
|
||||||
from kivy.app import App
|
from kivy.app import App
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ class ForestMapView(MapView):
|
||||||
app = App.get_running_app()
|
app = App.get_running_app()
|
||||||
print(self.get_bbox()) # debug gps position
|
print(self.get_bbox()) # debug gps position
|
||||||
min_lat, min_lon, max_lat, max_lon = self.get_bbox()
|
min_lat, min_lon, max_lat, max_lon = self.get_bbox()
|
||||||
sql_statement = "SELECT * FROM locations WHERE x > %s AND x < %s and y> %s AND Y < %s" % (min_lon, max_lon, min_lat, max_lat)
|
sql_statement = "SELECT * FROM locations WHERE x > %s AND x < %s AND y > %s AND y < %s" % (min_lat, max_lat, min_lon, max_lon) #sql_statement = "SELECT * FROM locations"
|
||||||
app.cursor.execute(sql_statement)
|
app.cursor.execute(sql_statement)
|
||||||
trees = app.cursor.fetchall()
|
trees = app.cursor.fetchall()
|
||||||
print(trees)
|
print(trees)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from kivy.garden.mapview import MapMarker
|
from kivy_garden.mapview import MapMarker
|
||||||
|
|
||||||
class GpsBlinker(MapMarker):
|
class GpsBlinker(MapMarker):
|
||||||
def blink(self):
|
def blink(self):
|
||||||
|
|
|
@ -3,3 +3,4 @@ sqlite_utils
|
||||||
Kivy
|
Kivy
|
||||||
Kivy-examples
|
Kivy-examples
|
||||||
kivymd
|
kivymd
|
||||||
|
mapview
|
||||||
|
|
Loading…
Reference in a new issue