make forestmap to use custom tile server

This commit is contained in:
Daniel afx 2020-10-24 03:57:42 +03:00
parent 5b8c010613
commit 866d41bf98
6 changed files with 16 additions and 7 deletions

3
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,3 @@
{
"python.pythonPath": "venv/bin/python3.8"
}

View file

@ -41,7 +41,7 @@ requirements = python3,setuptools,requests,certifi,urllib3,chardet,idna,sqlite3,
# (str) Custom source folders for requirements # (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes # Sets custom source for any requirements with recipes
# requirements.source.kivy = ../../kivy # requirements.source.kivy = ../../kivy
#requirements.source.kivy = ../kivysrc # requirements.source.kivy = %(source.dir)s/kivysrc
# (list) Garden requirements # (list) Garden requirements
#garden_requirements = #garden_requirements =

View file

@ -2,6 +2,13 @@
# cleanup virtual environment # cleanup virtual environment
rm -fr venv rm -fr venv
rm -fr __pycache__
# cleanup cache
#mapview
rm -fr cache
#mozilla
rm -fr .cache
# cleanup buildozer dirs # cleanup buildozer dirs
rm -fr .buildozer rm -fr .buildozer

View file

@ -16,7 +16,7 @@ class ForestBot(pydle.Client):
async def on_connect(self): async def on_connect(self):
await super().on_connect() await super().on_connect()
await self.join(CNC_CHANNEL) await self.join(CNC_CHANNEL)
await self.message(CNC_CHANNEL, '] {}'.format(MOTD)) await self.message(CNC_CHANNEL, MOTD)
async def is_admin(self, nickname): async def is_admin(self, nickname):
""" """

View file

@ -4,7 +4,6 @@
#:include treemarker.kv #:include treemarker.kv
<ForestMapView>: <ForestMapView>:
url: "http://forest.deflax.net:8111/tile/{z}/{x}/{y}.png"
lat: 42.131331 lat: 42.131331
lon: 24.747571 lon: 24.747571
zoom: 17 zoom: 17

View file

@ -1,15 +1,15 @@
from kivy.app import App from kivy.app import App
from kivy.clock import Clock from kivy.clock import Clock
from kivy_garden.mapview import MapView from kivy_garden.mapview import MapView, MapSource
from treemarker import TreeMarker from treemarker import TreeMarker
class ForestMapView(MapView): class ForestMapView(MapView):
get_trees_timer = None get_trees_timer = None
tree_names = [] tree_names = []
map_source = MapSource(url="http://forest.deflax.net/tile/{z}/{x}/{y}.png",
#def on_zoom(self, *args): cache_key="forest-map", tile_size=256,
# self.zoom = 10 image_ext="png", attribution="@ afx")
def print_current_zoom(self, *args): def print_current_zoom(self, *args):
print("] Zoom level: " + str(self.zoom)) print("] Zoom level: " + str(self.zoom))