You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to bring an mbtiles-map to MapView. When trying to run the code MBTilesMapSource crashed with following error
[...]
File "/home/jussi/Työpöytä/Jennin_homma/jennijenni.py", line 8, in build
map_source = MBTilesMapSource("map.mbtiles")
File "/home/jussi/.local/lib/python3.8/site-packages/kivy_garden/mapview/mbtsource.py", line 47, in init
cx = (bounds[2] + bounds[0]) / 2.0
TypeError: 'map' object is not subscriptable
I checked the lines in question:
if "bounds" in metadata:
self.bounds = bounds = map(float, metadata["bounds"].split(","))
if "center" in metadata:
cx, cy, cz = map(float, metadata["center"].split(","))
elif self.bounds:
cx = (bounds[2] + bounds[0]) / 2.0
cy = (bounds[3] + bounds[1]) / 2.0
cz = self.min_zoom
It is obvious that in elif-branch of the if-statement, a map-object is referenced by an index, which leads to the crash. I got my application working by turning the map-object to a list-object.
Well, I get the same issue after 4 years... Is this package maintained anymore? OOps: correction: looking at the source it seems to have been corrected, so I have my own problems here...
I'm trying to bring an mbtiles-map to MapView. When trying to run the code MBTilesMapSource crashed with following error
[...]
File "/home/jussi/Työpöytä/Jennin_homma/jennijenni.py", line 8, in build
map_source = MBTilesMapSource("map.mbtiles")
File "/home/jussi/.local/lib/python3.8/site-packages/kivy_garden/mapview/mbtsource.py", line 47, in init
cx = (bounds[2] + bounds[0]) / 2.0
TypeError: 'map' object is not subscriptable
I checked the lines in question:
It is obvious that in elif-branch of the if-statement, a map-object is referenced by an index, which leads to the crash. I got my application working by turning the map-object to a list-object.
To Reproduce
Try to run the MBTilesMapSource with following .mbtiles file
https://drive.google.com/file/d/1rdPAwFW-bx943vQEFGIazMoHE7Pgwtic/view?usp=sharing
Platform
System: Kernel: 5.4.0-48-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 Desktop: Cinnamon 4.6.7
wm: muffin dm: LightDM Distro: Linux Mint 20 Ulyana base: Ubuntu 20.04 focal
Python 3.8.2
MapView 1.0.5
Kivy 2.0.0rc3
Best regards,
The text was updated successfully, but these errors were encountered: