My mapview app is not loading the image and I don't know why
Asked
Active
Viewed 59 times
0
-
Please provide more details. – ipeacocks Oct 06 '21 at 23:05
-
1Without a [mre] we don't know either. – jonrsharpe Oct 06 '21 at 23:05
-
Im new to mapview. So i just run sime code every thing is fine but the map picture is not showing. And it says sdl2: unable to load image – Alamin Oct 06 '21 at 23:11
-
Please provide enough code so others can better understand or reproduce the problem. – Community Oct 11 '21 at 18:13
1 Answers
0
- Check and make sure your internet connection is working fast
- Make sure you have "requests" module
- 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)