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

Example doesn't work #48

Open
k3rne1pan1c opened this issue Sep 22, 2021 · 2 comments
Open

Example doesn't work #48

k3rne1pan1c opened this issue Sep 22, 2021 · 2 comments

Comments

@k3rne1pan1c
Copy link

Describe the bug
Using the example in the documentation throws an error due to a negative value used as a parameter.

To Reproduce
`
from kivy.garden.mapview import MapView, MapMarker
from kivy.app import App

class FirstKivy(App):

def build(self):

    map = MapView(zoom=13, lat=50.6394, lon=3.057)
    m1 = MapMarker(lon=50.6394, lat=3.057)  # Lille
    m2 = MapMarker(lon=-33.867, lat=151.206)

    map.add_marker(m1)
    map.add_marker(m2)

    return map

FirstKivy().run()
`

Expected behavior
Should work if you use it as an example

Logs/output

Traceback (most recent call last):
File "/home/k3rne1pan1c/Documents/projects/wherRu/main.py", line 15, in
FirstKivy().run()
File "/home/k3rne1pan1c/Documents/projects/wherRu/lib/python3.9/site-packages/kivy/app.py", line 949, in run
self._run_prepare()
File "/home/k3rne1pan1c/Documents/projects/wherRu/lib/python3.9/site-packages/kivy/app.py", line 919, in _run_prepare
root = self.build()
File "/home/k3rne1pan1c/Documents/projects/wherRu/main.py", line 12, in build
map.add_marker(m2)
File "/home/k3rne1pan1c/.kivy/garden/garden.mapview/mapview/view.py", line 464, in add_marker
layer.set_marker_position(self, marker)
File "/home/k3rne1pan1c/.kivy/garden/garden.mapview/mapview/view.py", line 247, in set_marker_position
x, y = mapview.get_window_xy_from(marker.lat, marker.lon, mapview.zoom)
File "/home/k3rne1pan1c/.kivy/garden/garden.mapview/mapview/view.py", line 361, in get_window_xy_from
y = ms.get_y(zoom, lat) - vy
File "/home/k3rne1pan1c/.kivy/garden/garden.mapview/mapview/source.py", line 94, in get_y
return ((1.0 - log(tan(lat) + 1.0 / cos(lat)) / pi) /
ValueError: math domain error

If applicable, add screenshots to help explain your problem.

Platform (please complete the following information):

  • OS: Pop!_OS 21.04
  • Python version: 3.9.5
@k3rne1pan1c
Copy link
Author

@k3rne1pan1c
Copy link
Author

I figured out, that in the develop branch you fixed the kivy updates. Can you merge the develop in the master? @tshirtman

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

1 participant