0

My mapview app is not loading the image and I don't know why

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
Alamin
  • 1
  • 1

1 Answers1

0
  1. Check and make sure your internet connection is working fast
  2. Make sure you have "requests" module
  3. Try out this example, make sure you have already installed all kivy_garden modules

Try this code:

import sys

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

if __name__ == '__main__' and __package__ is None:
    from os import path

    sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))


root = Builder.load_string(
    """
#:import sys sys
#:import MapSource kivy_garden.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)