garden.mapview | Migrated to https : //github.com/kivy-garden/mapview
kandi X-RAY | garden.mapview Summary
kandi X-RAY | garden.mapview Summary
Migrated to
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Update the viewport
- Set the zoom of the map
- Gets the column count for a given zoom level
- Apply bounds
- Create a marker for a feature
- Add a layer to map
- Reposition the canvas
- Load geojson
- Get the bounds of the feature
- Call func on each part of the geojson object
- Load a tile
- Return the row count for a given zoom level
- Add widget to map
- Gets the latitude of a tile in meters
- Set zoom on the map
- Get y coordinate from latitude and latitude
- Calculates the scaled scale
- Call func on each part of the layer
- Get the zoom level of a circle
- Initialize map source
- Compute the bounding box for a given zoom
- Adds a layer to the map
- Update the map
- Grab the touch
- Reposition the markers
- Reposition the widgets
- Calculate the haversine distance between two points
garden.mapview Key Features
garden.mapview Examples and Code Snippets
Community Discussions
Trending Discussions on garden.mapview
QUESTION
Hello guys. Hope you are all doing well.
I have just started using Kivy Mapview on Python and done some examples. Now, I am trying to create a dynamic marker which is able to move/reposition itself in every 0.5 seconds. I am conducting a project, and at the end of it I need to provide a real-time GPS tracking. That is the reason why I am trying to create a dynamic marker. Here is what I have tried:
.py file:
...ANSWER
Answered 2021-May-16 at 13:20Several problems with your code, but the main issue is that your MapViewApp
will never run, because there is an infinite loop in your build()
method. Since the build()
method never returns, the runTouchApp()
method never gets executed.
On a related note, you also do not want to put that infinite loop on the main thread of a kivy
App
. The updating of an App
GUI takes place on the main thread and if some method is hogging the main thread, the GUI will be frozen. Such a loop should be run on a separate thread, with any modifications that it makes to the GUI accomplished with something like Clock.schedule_once()
to get those GUI modifications back on the main thread.
QUESTION
from kivy.graphics.context_instructions import Color
from kivy.graphics.instructions import InstructionGroup
from kivy.graphics.vertex_instructions import Line
from kivy.properties import ObjectProperty
from kivy_garden.mapview import MapView, MapMarker
from kivy.app import App
from kivy.lang import Builder
kv = '''
MyMapView:
zoom: 2
double_tap_zoom: True
id: gps
Button:
text: " [86-6] "
background_color: (1,1,1,1)
color: (0,0,0,1)
font_size: 15
size_hint: (None,None)
width: 150
height: 30
on_press: root.gpss()
'''
class MyMapView(MapView):
grp = ObjectProperty(None)
def gpss(self):
self.ids.gps.lat = 48.20753856396109
self.ids.gps.lon = 16.372519189874197
class MapViewApp(App):
def build(self):
return Builder.load_string(kv)
MapViewApp().run()
...ANSWER
Answered 2021-Jan-27 at 18:30The problem is your use of ids
. The ids
of a kivy object are a dictionary to objects in the widget tree below the root. But the only id
you have assigned in your kv
is for the root node itself. So, no ids
are actually added to the ids
dictionary. That is what causes the error message (the ids
dictionary is empty). But since your gpss()
is a method of the MyMapView
object, you don't need to use ids
to get a reference to it, it is simply self
. So your gpss()
method can be changed to:
QUESTION
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.textinput import TextInput
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.properties import StringProperty
from kivy.properties import ObjectProperty
from kivy.uix.label import Label
from kivy.core.window import Window
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.uix.boxlayout import BoxLayout
from kivy_garden.mapview import MapView
...ANSWER
Answered 2021-Jan-06 at 00:46Your build()
method in the Map
class is never called (it is not called automatically). I suggest you change the build()
method to an on_enter()
method:
QUESTION
I am using kivy.garden.mapview for my application. Everything works properly, but problems arise when I try to deploy the application to Android with Buildozer. I set "garden_requirements = mapview" in the .spec file, and I always get the same error message: "Command failed: garden install --app mapview". The command fails even when I execute it on its own. The command "buildozer android debug deploy run logcat" produces the following output:
...ANSWER
Answered 2020-Jun-11 at 06:27The problematic error stems from this piece of information here:
Kivy-Garden==0.1.1
I had the same issue, buildozer, for some weird reason installs Kivy-Garden
version 0.1.1
which produces that error when you try to install ANY garden flower. Kivy
version 1.11.1
now uses Kivy-Garden>=0.1.4
which works without issues.
If you install Kivy-Garden==0.1.1
and try to install a package, it crushes with that error. However, If you upgrade to Kivy-Garden==0.1.4
. The problem is that buildozer
will install Kivy-Garden==0.1.1
no matter what you do. So I tried a lot of things from downgrading buildozer to manually activating the environment that buildozer
creates and upgrading garden there but when you run the buildozer command again. Buildozer will simply overwrite your upgraded garden AND install the non-working 0.1.1
.
Finally I just gave up and did the one thing I COULD do at this moment. Simply fix buildozer myself:
- Activate your environment(assuming you have one)
- Go to where
buildozer
is installed. In my case this is:/home/samuel/repo/mobile/venv/finager/lib/python3.7/site-packages/buildozer-1.2.0.dev0-py3.7.egg/buildozer/__init__.py
. You can find that out by checking the paths in your logs. - Now go to
Line 533
and change where it sayspip install Kivy-Garden==0.1.1
topip install Kivy-Garden==0.1.4
That's it, your problem should go away now.
I hope they fix this soon as this is a pretty simple thing to do. Kivy
itself requires Kivy-Garden>=0.1.4
which makes me wonder why buildozer
would want 0.1.1
when it clearly doesn't work
QUESTION
I have tried first my mapview function with only the mapview in the build which worked, but I had to return in the build mapview. Then I tried having the mapview on my first screen, and I face problems with it:
...ANSWER
Answered 2020-Jul-26 at 13:46Here is a version of your code that mostly works:
QUESTION
I'm trying to create an application which in the initial stage will consist of 2 windows.
The first window (LoginScreen) is a login window with a button that when you click it takes you to the second window.
The second window (MapScreen) should display a map using the MapView widget.
Description of the problemAfter starting the application, the LoginScreen works correctly.
After moving to MapScreen only MapMarketPopup widget without map is visible.
Codemain.py
...ANSWER
Answered 2020-Jun-14 at 18:23The way how I solve this problem is by creating a dynamic class.
MapScreen
is my second screen object and MapView
widget used as a child of the MapScreen
.
mapscreen.kv
QUESTION
Can anyone tell me why my app is crashing. It's very strange that when i run my app for the first time it doesn't crash. but the next time i run it it crashes. I get something like this. i am using KIVYMD, KIVY, SOCKET, KIVY MAPVIEW , SQLITE3. below is the error which i get through buildozer logcat.
...ANSWER
Answered 2020-May-08 at 19:22I had the same issue. In my case I've solve this by replace my hostpython3 by a 3.7.5 instead of 3.8.1. In your buildozer.spec requirements, you need to put hostpython3==3.7.5, python3==3.7.5
. After that delete your folder .buildozer/android/platform/build-armeabi and retry to build your app.
QUESTION
I want to connect two marker points together by drawing a line between them. I use Leaflet
map API from here: https://github.com/kivy-garden/garden.mapview
Code:
...ANSWER
Answered 2020-Mar-14 at 21:27You can use canvas
to draw a Line
, but you must include updating the line whenever the MapView
updates. Here is a simple approach for just one line:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install garden.mapview
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page