openlayers/ol3 — pull request #355 by marcjansen (2013-03-12 14:00:45+00:00)
Title: Add a screenshot script for our examples.

This script is supposed to be executed via phantomjs. It will generate
screenshots of the html files in the directory specified by a commandline
option when these files are served through a webserver which can also be
specified. The screenshots will be in the current working directory.

Example usage:

user@host:~/ol3/tools $ phantomjs example-screenshot.js \
http://localhost:8000/ol3/examples/ \
../examples/

The above command will generate `*.png` files in `tools/` for all html files
that are served through `http://localhost:8000/ol3/examples/`.

So if there is a file `my-humpty-example.html` inside of the relative folder
`../examples/` which is being served through the webserver so that
`http://localhost:8000/ol3/examples/my-humpty-example.html` is a valid and
reachable URL, this script will generate a screenshot and store it as
`my-humpty-example.html.png`.

The query string `?mode=raw` will be appended to the generated URL.

Known limitations:

As phantomjs doesn't support WebGL (see e.g.
https://github.com/ariya/phantomjs/wiki/Supported-Web-Standards and
http://code.google.com/p/phantomjs/issues/detail?id=273) This won't render
OpenLayers maps rendered through the webglrenderer.

In parts based upon this gist: https://gist.github.com/crazy4groovy/3160121