Kivy mapview

508 views
Skip to first unread message

sac

unread,
Nov 14, 2017, 10:41:52 AM11/14/17
to Kivy users support
This kivy mapview example work fines on windows, but doesn't work on android. Need some help here :) please

import sys
from kivy.base import runTouchApp
from kivy.lang import Builder
if __name__ == '__main__' and __package__ is None:
from os import sys, path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
import mapview
root = Builder.load_string("""
#:import sys sys
#:import MapSource mapview.MapSource
MapView:
lat: 50.6394
lon: 3.057
zoom: 13
map_source: MapSource(sys.argv[1], attribution="") if len(sys.argv) > 1 else "osm"
MapMarkerPopup:
lat: 50.6394
lon: 3.057
popup_size: dp(230), dp(130)
Bubble:
BoxLayout:
orientation: "horizontal"
padding: "5dp"
AsyncImage:
source: "http://upload.wikimedia.org/wikipedia/commons/9/9d/France-Lille-VieilleBourse-FacadeGrandPlace.jpg"
mipmap: True
Label:
text: "[b]Lille[/b]\\n1 154 861 hab\\n5 759 hab./km2"
markup: True
halign: "center"
""")
runTouchApp(root)

Jose Calderon-Celis

unread,
Nov 14, 2017, 5:33:50 PM11/14/17
to Kivy users support
Please use Courier New

from kivy.base import runTouchApp
from kivy.lang import Builder

if __name__ == '__main__' and __package__ is None:
     from os import sys, path
   sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))

import mapview  # not found!

Sachin s

unread,
Nov 14, 2017, 7:35:17 PM11/14/17
to kivy-...@googlegroups.com
Thanks so much for your reply, but just wondering where do i use Courier New in this code, so as i not new to kivy, but still atlearning phase, can you please advise here? Also for the import mapview, looks like I need to use from kivy.garden.mapview import mapview which in fact works, but only on Windows again. 

...

sac

unread,
Nov 14, 2017, 8:52:51 PM11/14/17
to Kivy users support
Sorry, may be you said me to use different font style while pasting here? my bad :), this time i used Courier New.. 

I agree with you "import mapview" # not found

but i also used "from kivy.garden.mapview import mapview" and also tried using "#:import Mapview kivy.garden.mapview.Mapview" in kv file in kivy format which in fact works just fine, but only on Windows again.I am really not able to understand why it just doesn't even start on Android, I also tried openssl, as a requirement on Buildozer "requirements" but still no luck. May be i am missing something or somewhere there is a tweak required on the code which i have to find out....

niavlys

unread,
Nov 15, 2017, 12:39:32 AM11/15/17
to Kivy users support
Have you set the garden_requirements in your buildozer.spec ?

sac

unread,
Nov 15, 2017, 1:54:41 AM11/15/17
to Kivy users support
Hi niavlys, Good catch, but can you advise what need to be set for garden_requirements in buildozer.spec please? 

niavlys

unread,
Nov 15, 2017, 6:09:23 AM11/15/17
to Kivy users support
it seems that the package name is being "gardenified"
https://github.com/kivy-garden/garden/blob/master/bin/garden#L183

so both
garden_requirements= mapview
or
garden_requirements= garden.mapview

should work.

sac

unread,
Nov 15, 2017, 9:55:06 AM11/15/17
to Kivy users support
Sure niavlys , thanks for that quick response and advise, will try and keep posted..fingers crossed :)

sac

unread,
Nov 15, 2017, 11:06:18 AM11/15/17
to Kivy users support
tried couple options with this, but still no luck :(


On Wednesday, November 15, 2017 at 7:09:23 PM UTC+8, niavlys wrote:

sac

unread,
Nov 15, 2017, 8:41:55 PM11/15/17
to Kivy users support
got that fixed, added mapview to garden_requirements and started from fresh, looks like that fixed.. thanks again niavlys :)


On Wednesday, November 15, 2017 at 7:09:23 PM UTC+8, niavlys wrote:
Reply all
Reply to author
Forward
0 new messages