This project is a rewrite taken from the repository webcomp-generic-map (thanks to pmoser). It is a webcomponent to display data from the Open Data Hub.
The Open Data Hub Team wants to generate reusable and independent visualization components to display data from the Open Data Hub easily. Using these webcomponents, a developer can easily integrate the functionality of the single components into any website.
Map that displays Lifts and Skiareas from Opendatahub Activity Endpoint
Do you want to see it in action? Go to our web component store!
Include the Javascript file dist/map_widget.min.js
in your HTML and define the web component like this:
<map-widget types="512" language="de" centermap=""></map-widget>
Type: bitmask Options: Refer to https://tourism.opendatahub.com/api/ActivityTypes
Type: string Options: "de,it,en"
Type: string Options: "latitude,longitude,zoomlevel" Pass latitude, longitude and zoomlevel separated by "," if map should be centered an a specific gps point
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
To build the project, the following prerequisites must be met:
- Node 12 / NPM 8.1.2
- Node 14 / NPM 6.14.18
For a ready to use Docker environment with all prerequisites already installed and prepared, you can check out the Docker environment section.
Get a copy of the repository:
git clone https://github.com/noi-techpark/webcomp-tourism-skiareas
Change directory:
cd webcomp-tourism-skiareas/
Download all dependencies:
npm install
Copy .env.example to .env and set all needed Environment Variables.
Build and start the project:
npm run watch
The application will be served and can be accessed at http://localhost:8080.
To create the distributable files, execute the following command:
npm run build
For the project a Docker environment is already prepared and ready to use with all necessary prerequisites.
These Docker containers are the same as used by the continuous integration servers.
Install Docker (with Docker Compose) locally on your machine.
First, install all dependencies:
docker-compose run --rm app /bin/bash -c "npm install"
Before start working you have to start the Docker containers:
docker-compose up --build --detach
After finished working you can stop the Docker containers:
docker-compose stop
When the containers are running, you can execute any command inside the environment. Just replace the dots ...
in the following example with the command you wish to execute:
docker-compose run --rm app /bin/bash -c "..."
Some examples are:
docker-compose run --rm app /bin/bash -c "npm run build"
For support, please contact [email protected].
If you'd like to contribute, please follow the Contributor Guidelines that can be found at https://github.com/noi-techpark/odh-docs/wiki/Contributor-Guidelines%3A-Getting-started.
More documentation can be found at https://opendatahub.readthedocs.io/en/latest/index.html.
The project uses this boilerplate: https://github.com/noi-techpark/webcomp-boilerplate.
The code in this project is licensed under the GNU AFFERO GENERAL PUBLIC LICENSE Version 3 license. See the LICENSE.md file for more information.
This project is REUSE compliant, more information about the usage of REUSE in NOI Techpark repositories can be found here.
Since the CI for this project checks for REUSE compliance you might find it useful to use a pre-commit hook checking for REUSE compliance locally. The pre-commit-config file in the repository root is already configured to check for REUSE compliance with help of the pre-commit tool.
Install the tool by running:
pip install pre-commit
Then install the pre-commit hook via the config file by running:
pre-commit install