Erdapfel is Qwant Maps front end application. It is a javascript single page app that allows to browse the map, search for places, see your position on the map, etc
For a global overview of Qwant Maps and more details about each component, check out QwantMaps repo.
As Qwant Maps front end app, Erdapfel relies on a bunch of other services and needs some config to define how to interact with these components.
A default config file is provided here. You will need to update it to set some services url, for instance:
- the tile server: to display the map
- the geocoder: to search for places
- the place API: to display some details about the places
- the storage app: to store your favorite places
The configuration can be overriden by environment variables.
The nesting is handle by the separator _
and it must be prefixed by TILEVIEW_
For instance:
system:
timeout: 5
is overriden by TILEVIEW_system_timeout=3
You will need
- npm >= 6
- node >= 8
Then you can build and run Erdapfel with the following commands:
> npm install
> npm run build
# to build in development mode:
> npm run build -- --mode=development
> npm start
Pull the docker image from qwantresearch/erdapfel
, set up your config and voilà !
Some requests to node server could trigger this message on node server logs:
"msg":"unable to get local issuer certificate"
You can overpass this error by setting NODE_TLS_REJECT_UNAUTHORIZED=0
on the server environment such as:
> NODE_TLS_REJECT_UNAUTHORIZED=0 npm run start
Note that you are NEVER supposed to use this option for anything else than development.
The icon font comes from icomoon, the icomoon project is kept in dev/erdapfel_iconmoon.json
file. You can open it by drag and drop this file on the icomoon web page.
run TEST=true npm run build
then npm run test
to launch all tests.
Run unit tests only with npm run unit-test
Run integration tests only with npm run integration-test
It will run chrome headless test suite with a mapbox-gl minimalist mock. The config override is done in the server_start file.
note on mapbox-gl mock: We include out mapbox-gl mock fork to emulate mapbox-gl behaviour with the advanced support of mocked event & poi.
hint : When you debug or add new tests, you may want to launch puppeteer in non headless mode and keep the browser open by setting the environment variable headless
to false
.
npm run bench
will build a production bundle and return size and js execution time metrics to compare evolution of application performance along the project life time.
/style.json
gives access to prebuilt style with (optional) language.
A small script is used behind the scene to build the style of the map and to ease the usage of the icons for the front end. The fonts used for the text displayed on the map are also built using an OpenMapTiles script.
Parameters:
method | name | value | optional | default |
---|---|---|---|---|
get | lang | en, gb ... | true | en |
This project is licensed under the Apache License 2.0.
Please not that it depends on many other opensource projects that have their own terms and conditions.