diff --git a/databases/fountains.db b/databases/fountains.db index b0e90a8..89c4e18 100644 Binary files a/databases/fountains.db and b/databases/fountains.db differ diff --git a/databases/populatedb.py b/databases/populatedb.py index 5a7bcf8..c1c6f80 100755 --- a/databases/populatedb.py +++ b/databases/populatedb.py @@ -26,8 +26,8 @@ def iterate_kml(filepath): yield { "FMID": autoincrement, "MarketName": name, - "Website": "https://deflax.net", - "Facebook": "https://facebook.com/page", + "Website": "web_url", + "Facebook": "fb_page_id", "Twitter": "tw_user", "Youtube": "yt_user", "OtherMedia": "om_user", diff --git a/forestmapview.kv b/forestmapview.kv index 6af43a4..8726756 100644 --- a/forestmapview.kv +++ b/forestmapview.kv @@ -7,7 +7,8 @@ lat: 42.131331 lon: 24.747571 zoom: 17 - snap_to_zoom: False + snap_to_zoom: True + pause_on_action: True on_zoom: #self.zoom = 10 if self.zoom < 10 else self.zoom #self.print_current_zoom(self.zoom) diff --git a/forestmapview.py b/forestmapview.py index 1b3276c..06dc42e 100644 --- a/forestmapview.py +++ b/forestmapview.py @@ -1,6 +1,6 @@ -from kivy_garden.mapview import MapView -from kivy.clock import Clock from kivy.app import App +from kivy.clock import Clock +from kivy_garden.mapview import MapView from treemarker import TreeMarker @@ -34,7 +34,7 @@ class ForestMapView(MapView): trees = app.cursor.fetchall() for tree in trees: name = tree[0] - print("] Fountain detected: " + str(tree)) + #print("] Fountain detected: " + str(tree)) if name in self.tree_names: continue else: diff --git a/kivymd/uix/dialog.py b/kivymd/uix/dialog.py index 0513ddb..e15776b 100644 --- a/kivymd/uix/dialog.py +++ b/kivymd/uix/dialog.py @@ -191,6 +191,11 @@ Builder.load_string( size: self.size Color: rgba: [1,0,0,.5] + ThinBox: + ThinLabel: + text: "Name: " + ThinLabelButton: + text: root.MarketName ThinBox: ThinLabel: text: "Address: " @@ -598,7 +603,7 @@ class BaseDialog(ThemableBehavior, ModalView): ) class ListMDDialog(BaseDialog): - name = StringProperty("Missing data") + MarketName = StringProperty("Missing data") address = StringProperty("Missing data") Website = StringProperty("Missing data") Facebook = StringProperty("Missing data") diff --git a/main.kv b/main.kv index 9d5de29..f69d7ac 100644 --- a/main.kv +++ b/main.kv @@ -2,9 +2,5 @@ BoxLayout: orientation: 'vertical' - MDToolbar: - title: "Global Forest" - right_action_items: [['magnify', lambda x: app.search_menu.open()]] - md_bg_color: app.theme_cls.primary_color ForestMapView: id: forestmapview diff --git a/main.py b/main.py index 9c18e5e..3c9f7ed 100644 --- a/main.py +++ b/main.py @@ -17,7 +17,7 @@ from kivy.graphics import Rectangle # Import local modules from forestmapview import ForestMapView -from searchpopupmenu import SearchPopupMenu +#from searchpopupmenu import SearchPopupMenu from gpshelper import GpsHelper from settings import SampleBoxLayout from game import GameWidget @@ -76,7 +76,7 @@ class MainApp(MDApp): self.cursor = self.connection.cursor() # Instantiate SearchPopupMenu - self.search_menu = SearchPopupMenu() + #self.search_menu = SearchPopupMenu() if __name__ == '__main__': #screen_manager = ScreenManager() diff --git a/treemarker.py b/treemarker.py index d8e63bf..902d697 100644 --- a/treemarker.py +++ b/treemarker.py @@ -1,11 +1,21 @@ +from kivy.app import App +from kivy.clock import Clock from kivy_garden.mapview import MapMarkerPopup + 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) + # Open the TreePopupMenu menu = TreePopupMenu(self.tree_data) menu.size_hint = [.8, .9] - menu.open() + Clock.schedule_once(menu.open, 1) + + def update_forestmap_position(self): + print("] New Forest Map POSITION", self.lat, self.lon) diff --git a/treepopupmenu.py b/treepopupmenu.py index 309488f..07bbc1d 100644 --- a/treepopupmenu.py +++ b/treepopupmenu.py @@ -4,16 +4,14 @@ class TreePopupMenu(ListMDDialog): def __init__(self, tree_data): super().__init__() - print("] Selected tree data: " + str(tree_data)) + #print("] Selected tree data: " + str(tree_data)) # Set all of the fields of tree data - #headers = "Name,Lat,Lon,Description" headers = "FMID,MarketName,Website,Facebook,Twitter,Youtube,OtherMedia,street,city,County,State,zip,Season1Date,Season1Time,Season2Date,Season2Time,Season3Date,Season3Time,Season4Date,Season4Time,x,y,Location,Credit,WIC,WICcash,SFMNP,SNAP,Organic,Bakedgoods,Cheese,Crafts,Flowers,Eggs,Seafood,Herbs,Vegetables,Honey,Jams,Maple,Meat,Nursery,Nuts,Plants,Poultry,Prepared,Soap,Trees,Wine,Coffee,Beans,Fruits,Grains,Juices,Mushrooms,PetFood,Tofu,WildHarvested,updateTime" headers = headers.split(',') for i in range(len(headers)): attribute_name = headers[i] - #print("attr name " + str(attribute_name)) attribute_value = tree_data[i] - #print("attr value " + str(attribute_value)) + #print("] " + str(attribute_name) + " = " + str(attribute_value)) setattr(self, attribute_name, attribute_value)