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
# COMPOSE_FILE := docker-compose-web.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
@ -8,6 +9,13 @@ COMPOSE_FILE := docker-compose.yml
# DOCKER MANAGEMENT
###
status:
@echo
@echo "------------------------------------------------------------------"
@echo "Status in production mode"
@echo "------------------------------------------------------------------"
@docker-compose -f $(COMPOSE_FILE) -p $(PROJECT_ID) ps
build:
@echo

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

@ -21,11 +21,10 @@
from os.path import exists, join, isabs, abspath
from os import listdir, environ
from sys import exit
from sys import exit, stderr
from subprocess import call, Popen, PIPE
from datetime import datetime
from time import sleep
from sys import stderr
class Downloader(object):
@ -47,7 +46,7 @@ class Downloader(object):
@staticmethod
def info(message):
print message
print(message)
@staticmethod
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 :
'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
![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;
}
}
xmlhttp.open("GET", "/settings/timestamp.txt", false );
xmlhttp.open("GET", "settings/timestamp.txt", false );
xmlhttp.send();
document.getElementById('overlay').innerHTML = timestamp;
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 wms = L.tileLayer.wms("http://localhost:8198/cgi-bin/qgis_mapserv.fcgi?", {
map: '/web/project.qgs',
layers: 'project',
var wms = L.tileLayer.wms("http://localhost:8198/", {
layers: 'osm_buildings20160720014515980',
format: 'image/png',
transparent: true,
attribution: "OpenStreetMap"

Plik diff jest za duży Load Diff