Git Product home page Git Product logo

wallpapermapsmaker's Introduction

WallPaperMapsMaker

Makes a beautiful collection of maps for wallpaper.

This is a simple Python script that allows printing several maps of a desired location and zoom level, benefiting from available online maps. Based on OpenLayers 2 and wkhtmltopdf.

How it is working?

  • Download the application and run the wallpapermapsmaker.py script while connected to the internet.
  • For changing the location of the map, set the center of the maps in longitude and latitude (in decimal degrees) in the Python variables lon and lat, and the zoom level in zoom.
  • For changing the layers, you may choose different layer names in the layers Python variable.
  • Have a look of the map (e.g., for checking location) by opening the ol2/map.html file.

The basics

The basics of the WallPaperMapsMaker are:

  • A html file loads the map tiles from different map providers using the javascript library OpenLayers 2.
  • The library wkhtmltopdf is used to generated pdf files from the html file.
  • All A4 pdfs are collated in one. The maps can be printed as A4 and used to set up a wallpaper.
  • Or the pdfs can be merged into A3, A2, A1, A0, etc. using pdf imposition, e.g. with pdfjam.
  • A version of the script in R was also developed.
  • A version of the map using OpenLayers 3 (ol3) was developed but there is a problem working with wkhtmltopdf and OpenLayers 3.

Thanks

Thanks to, of course, contributors of OpenStreetMap from which most of the maps printed here are derived. The creator(s) of the website Map Compare (http://mc.bbbike.org/mc/) must be granted as well as this website allows to discover and select hundreds of map styles.

Some notes

An A4 in 300 dpi is 2480 x 3508 px An A4 in 200 dpi is 1654 x 2339 px

→ But this results in a 1.5 page pdf with the content at the right which is overflown and not printed!

  • Moving the page-size in wkhtmltopdf from A4 to A3 did change as more content could be printed on the first page. So changing the format options in wkhtmltopdf must imply that we change the width/height of the html id map object
  • changing the –dpi option in wkhtmltopdf does change nothing, the pdf file size is idem and the printed area is idem.
  • changing the height/width of the html id map change of course the extent of the map!
  • the option “zoom” in wkhtmltopdf has no effect.
  • the zoom css option did do he job of zooming!!! But id map size must be changed accordingly

Good size for an A4 is "width:2105px ; height:1480px" at zoom = 100%

  • example of use of pdfjam: merge 16 A4 pdf in a landscape-oriented A1 pdf:
pdfjam --nup 4x4 map2.pdf map3.pdf map4.pdf map11.pdf map9.pdf map16.pdf map19.pdf map8.pdf map14.pdf map12.pdf map17.pdf map15.pdf map10.pdf map5.pdf map18.pdf map1.pdf --trim '0.3cm 0.3cm 0.3cm 0.3cm' --clip true --landscape --a1paper --outfile mapA1.pdf

TODOs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.