For Kivy desktop applications, you have another option for cards. You can use CEF Python to embed a web browser in a Kivy application. You can direct this browser to an HTML file that loads web maps.
To use Python CEF, you will need to install the cefpython3 module. I am sure you can install this using:
kivy -m pip install cefpython3
otherwise, you can use the traditional pip install and move the module to a place where kivy can access it.
From this sample code, I made the following example by changing the start_url web browser, for example:
start_url="file://"+GetApplicationPath("testMaps.html")
Where testMaps.html is an HTML file with this sample Google Maps code (HTML + JavaScript version).
The Kivy code that I run is long and rather complicated, because CEF Python requires a lot of customization ... I probably do not need all the code that is there, but I have not tried to lose weight though.
Here is the code! (you need to download it)
Yes ... quite meaty. The HTML file must be in the same directory as the above code in order for it to work correctly. Also, I put this together on a Mac, and some things may be different on Windows and Linux. Although the sample code that I started working with was written for Linux, so it may happen that only Windows people run into difficulties.
If you received a code to run, and you are wondering why the buttons forward and backward are needed; this is just a legacy from the example code that I used as the base, and has nothing to do with the map.
Last note: I used Google Maps for this example, but with this method you could use any web-based mapping utility.
dslosky
source share