Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mapview not working on Kivy 2.0.0 #44

Closed
kushurox opened this issue Jan 5, 2021 · 12 comments
Closed

mapview not working on Kivy 2.0.0 #44

kushurox opened this issue Jan 5, 2021 · 12 comments

Comments

@kushurox
Copy link

kushurox commented Jan 5, 2021

Describe the bug
kivy garden, Map View doesn't Work on kivy version 2.0.0, I have tried it on 1.11.1 and the code worked.

To Reproduce
from kivy_garden.mapview import MapView, MapMarker
from kivymd.app import MDApp
from kivymd.uix.floatlayout import MDFloatLayout

class MapWidget(MDFloatLayout):
def init(self):
super(RealBoss, self).init()
m = MapView(zoom=11, lat=50.6394, lon=3.057, on_map_relocated=self.func)
self.add_widget(m)
marker = MapMarker(lat=50.6394, lon=3.057)
m.add_marker(marker)

def func(self, *args):
    print(args)

class Try(MDApp):
def build(self):
return MapWidget()

Try().run()

Expected behavior
a red marker to be placed on the map

Screenshot
Screenshot 2021-01-05 at 4 30 28 PM

Console
[INFO ] [Logger ] Record log in /Users/name/.kivy/logs/kivy_21-01-05_119.txt
[INFO ] [Kivy ] v2.0.0
[INFO ] [Kivy ] Installed at "/Users/name/PycharmProjects/GUI_is_Cool/venv/lib/python3.7/site-packages/kivy/init.py"
[INFO ] [Python ] v3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 03:13:28)
[Clang 6.0 (clang-600.0.57)]
[INFO ] [Python ] Interpreter at "/Users/name/PycharmProjects/GUI_is_Cool/venv/bin/python"
[INFO ] [Factory ] 186 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_imageio, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO ] [Window ] Provider: sdl2
[INFO ] [GL ] Using the "OpenGL ES 2" graphics system
[INFO ] [GL ] Backend used
[INFO ] [GL ] OpenGL version <b'2.1 INTEL-16.1.7'>
[INFO ] [GL ] OpenGL vendor <b'Intel Inc.'>
[INFO ] [GL ] OpenGL renderer <b'Intel(R) Iris(TM) Graphics 6100'>
[INFO ] [GL ] OpenGL parsed version: 2, 1
[INFO ] [GL ] Shading version <b'1.20'>
[INFO ] [GL ] Texture max size <16384>
[INFO ] [GL ] Texture max units <16>
[INFO ] [Window ] auto add sdl2 input provider
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[INFO ] [Text ] Provider: sdl2
[INFO ] [KivyMD ] 0.104.2.dev0, git-Unknown, 2021-01-04 (installed at "/Users/name/PycharmProjects/GUI_is_Cool/venv/lib/python3.7/site-packages/kivymd/init.py")
[INFO ] [GL ] NPOT texture support is available
[ERROR ] [Image ] Not found <icons/sunny.png>
[INFO ] [Base ] Start application main loop

Platform (please complete the following information):

  • OS: MacOS Big Sur, Version 1.11
  • Python version: 3.7.1
@kushurox
Copy link
Author

kushurox commented Jan 5, 2021

i have tried using source as well. Nothing appeared as well

@xdevkroom
Copy link

# Now it's working well

from kivy_garden.mapview import MapView, MapMarker
from kivymd.app import MDApp
from kivymd.uix.floatlayout import MDFloatLayout

class MapWidget(MDFloatLayout):
    def __init__(self):
        super(MapWidget,self).__init__()
        m = MapView(zoom=11, lat=50.6394, lon=3.057, on_map_relocated=self.func)
        self.add_widget(m)
        marker = MapMarker(lat=50.6394, lon=3.057)
        m.add_marker(marker)

    def func(self, *args):
        print(args)
class Try(MDApp):
    def build(self):
        return MapWidget()

Try().run()

@kushurox
Copy link
Author

kushurox commented Jan 6, 2021

it is still same.
Screenshot 2021-01-06 at 12 42 07 PM

@alexnaoki
Copy link

alexnaoki commented Jan 8, 2021

I was having the same problem. I solved this by using my own source ".png".

marker = MapMarker(lat=50.6394, lon=3.057, source='newMarker.png')

@alexnaoki
Copy link

Using kivy==1.11.1, there is no problem with the marker's source. I believe there are some incompatibilities with kivy==2.0

@kushurox
Copy link
Author

kushurox commented Jan 9, 2021

yeah the problem with 1.11.1 was that the md animations werent smooth. so i had to upgrade to 2.0.0

@runette
Copy link

runette commented Jan 21, 2021

I have the same problem and I am a little confused about the issue is closed since it seems to be a real issue

@kushurox kushurox reopened this Jan 24, 2021
@kushurox
Copy link
Author

alright ill just keep it open until the mods close it

@Sahil-pixel
Copy link

Sahil-pixel commented Feb 18, 2021

i am facing same problem with kivy 2.0.0 but there is no problem with kivy==1.11.1

@runette
Copy link

runette commented Feb 18, 2021

What I ended up doing is downloading the whole of mapview into my project (it is neither very big nor does it change very fast - if at all) and then solving this problem by explicitly referencing the marker icon:

MapMarker(lat=self.lat, lon=self.lon, source='%path_to_icons%/Marker.png'))

where you do, of course, replace %path_to_icons% with the place that you put the mapview icons folder!

@macdems
Copy link
Contributor

macdems commented Jul 5, 2021

This issue is caused by the fact that Kivy 2.0.0 does not load the image if the default source value is not changed. I have created a pull request #47 resolving this.

@Ryan-Ashton
Copy link

That's great. Hopefully the pull request gets approved soon.

tshirtman added a commit that referenced this issue Jul 24, 2021
Fix #44 (missing markers in Kivy 2.0.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants