resurrect the display in webbrowser

pull/45/head
Etienne Trimaille 2018-03-09 10:01:05 +01:00
rodzic 72bc59e3e9
commit 4cb08e2666
7 zmienionych plików z 282 dodań i 1690 usunięć

Wyświetl plik

@ -1,6 +1,7 @@
PROJECT_ID := dockerosm PROJECT_ID := dockerosm
# COMPOSE_FILE := docker-compose-web.yml
COMPOSE_FILE := docker-compose.yml COMPOSE_FILE := docker-compose.yml
# Uncomment the next line if you want to display data with Leaflet.
# COMPOSE_FILE := docker-compose-web.yml
.PHONY: logs .PHONY: logs
@ -8,6 +9,13 @@ COMPOSE_FILE := docker-compose.yml
# DOCKER MANAGEMENT # DOCKER MANAGEMENT
### ###
status:
@echo
@echo "------------------------------------------------------------------"
@echo "Status in production mode"
@echo "------------------------------------------------------------------"
@docker-compose -f $(COMPOSE_FILE) -p $(PROJECT_ID) ps
build: build:
@echo @echo

Wyświetl plik

@ -93,14 +93,14 @@ osmupdate:
- TIME=120 - TIME=120
qgisserver: qgisserver:
image: kartoza/qgis-server:2.14 image: kartoza/qgis-server:2.18
hostname: dockerosm_qgisserver hostname: dockerosm_qgisserver
container_name: dockerosm_qgisserver container_name: dockerosm_qgisserver
#volumes_from: #volumes_from:
# - btsync # - btsync
volumes: volumes:
- ./logs:/var/log/apache2 - ./logs:/var/log/apache2
- ./web:/web - ./web:/project
- ./settings:/web/settings - ./settings:/web/settings
links: links:
- db:db - db:db

Wyświetl plik

@ -19,14 +19,13 @@
***************************************************************************/ ***************************************************************************/
""" """
from sys import exit from sys import exit, stderr
from os import environ, listdir from os import environ, listdir
from shutil import move from shutil import move
from os.path import join, exists, abspath, isabs from os.path import join, exists, abspath, isabs
from psycopg2 import connect, OperationalError from psycopg2 import connect, OperationalError
from subprocess import call from subprocess import call
from time import sleep from time import sleep
from sys import stderr
class Importer(object): class Importer(object):
@ -64,7 +63,7 @@ class Importer(object):
@staticmethod @staticmethod
def info(message): def info(message):
print message print(message)
@staticmethod @staticmethod
def error(message): def error(message):

Wyświetl plik

@ -21,11 +21,10 @@
from os.path import exists, join, isabs, abspath from os.path import exists, join, isabs, abspath
from os import listdir, environ from os import listdir, environ
from sys import exit from sys import exit, stderr
from subprocess import call, Popen, PIPE from subprocess import call, Popen, PIPE
from datetime import datetime from datetime import datetime
from time import sleep from time import sleep
from sys import stderr
class Downloader(object): class Downloader(object):
@ -47,7 +46,7 @@ class Downloader(object):
@staticmethod @staticmethod
def info(message): def info(message):
print message print(message)
@staticmethod @staticmethod
def error(message): def error(message):

Wyświetl plik

@ -80,6 +80,19 @@ You can check the timestamp of your database by reading the file :
or you can use : or you can use :
'make timestamp' 'make timestamp'
### Display
In the makefile, you can switch to another docker compose project.
The other one includes QGIS Server. When it's running, you should be able to
open, on the host(not in docker), the `index.html` file and see OSM and QGIS
Server showing PostGIS tables. The webpage is using Leaflet.
If you want to tweak the QGIS Project, you need to add a host in your in `/etc/hosts`:
```
127.0.0.1 db
```
Because in the docker-compose file, the link is made with the PostGIS database using the alias `db`.
## In the background ## In the background
![architecture](https://raw.githubusercontent.com/kartoza/docker-osm/develop/docs/docker-compose.png) ![architecture](https://raw.githubusercontent.com/kartoza/docker-osm/develop/docs/docker-compose.png)

Wyświetl plik

@ -35,16 +35,15 @@ xmlhttp.onreadystatechange=function() {
timestamp = xmlhttp.responseText; timestamp = xmlhttp.responseText;
} }
} }
xmlhttp.open("GET", "/settings/timestamp.txt", false ); xmlhttp.open("GET", "settings/timestamp.txt", false );
xmlhttp.send(); xmlhttp.send();
document.getElementById('overlay').innerHTML = timestamp; document.getElementById('overlay').innerHTML = timestamp;
var map = L.map('map').setView([0, 0], 3); var map = L.map('map').setView([0, 0], 3);
var osm = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png?').addTo(map); var osm = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png?').addTo(map);
var wms = L.tileLayer.wms("http://localhost:8198/cgi-bin/qgis_mapserv.fcgi?", { var wms = L.tileLayer.wms("http://localhost:8198/", {
map: '/web/project.qgs', layers: 'osm_buildings20160720014515980',
layers: 'project',
format: 'image/png', format: 'image/png',
transparent: true, transparent: true,
attribution: "OpenStreetMap" attribution: "OpenStreetMap"

Plik diff jest za duży Load Diff