WARNING: This is outdated!!!
- Docker
Create project directory:
mkdir freemap-mapnik
cd freemap-mapnik
Install Docker and from the project home directory (freemap-mapnik) run the following commands:
# create network
docker network create --driver bridge freemap-bridge
# prepare volume for PostgreSQL
docker volume create pgdata
# start database
docker run --rm --name=freemap-postgis -v pgdata:/var/lib/postgresql/data --network=freemap-bridge -e POSTGRES_PASSWORD=secret -d mdillon/postgis
# clone the project and prepare map data (Slovakia)
docker run --rm --name=freemap-mapnik -v $(pwd):/freemap-mapnik --network=freemap-bridge -p 4000:4000 -w /freemap-mapnik -it zdila/freemap-mapnik-dev-env bash -c 'git clone https://github.com/FreemapSlovakia/freemap-mapnik.git . && ./docker/prepare_osm.sh && ./docker/prepare_hillshading.sh && ./docker/prepare_contours.sh'
# apply additional SQL scripts
docker run --rm --name=freemap-mapnik -v $(pwd):/freemap-mapnik --network=freemap-bridge -p 4000:4000 -w /freemap-mapnik -it zdila/freemap-mapnik-dev-env bash -c 'apt-get update && apt-get -y install --no-install-recommends postgresql-client && cat additional.sql | PGPASSWORD=secret psql -h freemap-postgis postgres postgres'
From project home directory (freemap-mapnik) run following commands:
docker run --rm --name=freemap-mapnik -v $(pwd):/freemap-mapnik --network=freemap-bridge -p 4000:4000 -w /freemap-mapnik -e NODE_ENV=docker -it zdila/freemap-mapnik-dev-env bash -c 'npm i && npm run watch'
Alternatives:
- open preview.html in your browser
- after changing and saving some style (eg. app/style/index.js) just reload the page
- use any app where you can enter following TMS URL template:
http://localhost:4000/{z}/{x}/{y}
- use JSOM
- use TMS map URL
tms[19]:http://localhost:4000/{zoom}/{x}/{y}
- after changing and saving some style right-click the map and choose FLush tile cache.
- use TMS map URL