I tried Kivy's mapview

Summary

There was an add-on (MapView) that displays a map in a project that manages Kivy add-ons called Kivy Garden, so I tried it. Details of Garden are below https://kivy.org/docs/api-kivy.garden.html You can install it with pip. pip install kivy-garden

Preparation

For the time being, read the README on Github and prepare. https://github.com/kivy-garden/garden.mapview First, install the required environment. pip install futures requests Next, install mapview. garden install mapview

Now you are ready to go.

Try using MapView

For the time being, I will display a map centered on Tokyo Station.

main.py


from kivy.garden.mapview import MapView
from kivy.app import App

class MapViewApp(App):
    def build(self):
        mapview = MapView(zoom=15, lat=35.681382, lon=139.766084)
        return mapview
    
MapViewApp().run()

The execution result is as follows. A map centered on Tokyo Station was displayed. image

Next, try displaying a marker at the location of Tokyo Station. Rewrite the code as follows.

main.py


from kivy.garden.mapview import MapView, MapMarkerPopup
from kivy.app import App

class MapViewApp(App):
    def build(self):
        mapview = MapView(zoom=15, lat=35.681382, lon=139.766084)
        marker1 = MapMarkerPopup(lat=35.681382, lon=139.766084) 
        mapview.add_marker(marker1)
        return mapview
    
MapViewApp().run()

When I looked at the execution result, the marker was displayed well. image

So it was very easy to display the map. By the way, the map called in MapView is that of OpenStreetMap. (http://www.openstreetmap.org/)

Recommended Posts

I tried Kivy's mapview
I tried kivy's reStructuredText renderer
I tried scraping
I tried PyQ
I tried papermill
I tried django-slack
I tried Django
I tried spleeter
I tried cgo
I tried using parameterized
I tried using argparse
I tried using mimesis
I tried using anytree
I tried competitive programming
I tried running pymc
I tried ARP spoofing
I tried using Summpy
I tried Python> autopep8
I tried using coturn
I tried using Pipenv
I tried using matplotlib
I tried using "Anvil".
I tried using Hubot
I tried using ESPCN
I tried using openpyxl
I tried deep learning
I tried AWS CDK!
I tried using Ipython
I tried to debug.
I tried using PyCaret
I tried using cron
I tried using ngrok
I tried using face_recognition
I tried to paste
I tried using Jupyter
I tried using PyCaret
I tried moving EfficientDet
I tried shell programming
I tried using Heapq
I tried using doctest
I tried Python> decorator
I tried running TensorFlow
I tried Auto Gluon
I tried using folium
I tried using jinja2
I tried AWS Iot
I tried Bayesian optimization!
I tried using folium
I tried using time-window
I tried Value Iteration Networks
I tried scraping with Python
I tried AutoGluon's Image Classification
I tried to learn PredNet
[I tried using Pythonista 3] Introduction
I tried using easydict (memo).
I tried face recognition using Face ++
I tried using Random Forest
I tried clustering with PyCaret
I tried using BigQuery ML
I tried "K-Fold Target Encoding"
I tried to implement PCANet