Skip to content

plavacquery/erdapfel

 
 

Repository files navigation

Erdapfel

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

Qwant Maps screenshot

For a global overview of Qwant Maps and more details about each component, check out QwantMaps repo.

Run

Configuration

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

Run from sources

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

Run with docker

Pull the docker image from qwantresearch/erdapfel Docker Pulls , set up your config and voilà !

Develop

Travis Build

Local node TLS errors (only for development and debug, NOT production!!!)

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.

A note about webfont

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.

Test

run TEST=true npm run build then npm run test to launch all tests.

Unit tests

Run unit tests only with npm run unit-test

Integration tests

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.

Benchmark

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.

EntryPoints

Style

/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

License

GitHub license

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.

About

Qwant Maps front-end

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 73.9%
  • CSS 22.2%
  • HTML 3.4%
  • Other 0.5%