A web component that shows the events stored in the Open Data Hub.
Do you want to see it in action? Go to our web component store!
Include the webcomp script file dist/odh-events.js in your HTML and define the web component like this:
<odh-events
width="100%"
height="500px"
fontFamily="Arial"
language="it"
mapAttribution='© <a href="https://openstreetmap.org/copyright">OpenStreetMap contributors</a>'
currentLocation='{ "lat": 46.31, "lng": 11.26 }'
tiles-url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
modality="list"
pageSize="5"
categoriesFilter="[8,16]">
</odh-events>Give a fixed width to the component. Works only from desktop up. You can use whatever size unit you want.
Examples: "100%" or "200px"
Give a fixed height to the component. Works only from desktop up. You can use whatever size unit you want.
Example: "500px" or "100%"
Set the typeface.
Example: "Arial"
Set the default and starting language.
Example: "en" or "de" or "it"
Set the acknowledgement for the map tiles provider.
Example: '© <a href="https://openstreetmap.org/copyright">OpenStreetMap contributors</a>'
Set the starting point position on the map.
Example: '{ "lat": 46.31, "lng": 11.26 }'
Set the URL of the API that provides the tiles.
Example: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
Set the default and starting value for the modality of the widget.
Example: "list" or "map"
Set the default and starting value for the modality of the widget. Default value is 10.
Example: "5"
The radius expressed in kilometers with which to filter events. Default value is 0.
Example: "5"
If set the road directions are hidden.
If set, all the gastronomies are filtered by the bitmask values in the array.
Example: "[8,16]"
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 14.15.4 / NPM 8.1.2
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 git@github.com:noi-techpark/webcomp-events.gitChange directory:
cd webcomp-events/Create a .env file in the main directory.
Fill it with this content:
HEREMAPS_API_KEY=YourKey
Replace YourKey with your API token to use the tiles and the search bar.
Download all dependencies:
npm installBuild and start the project:
npm run startThe application will be served and can be accessed at http://localhost:8080.
To create the distributable files, execute the following command:
npm run buildNOT IMPLEMENTED
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 "yarn start"ToDo: For support, please contact help@opendatahub.com.
If you'd like to contribute, please follow the following instructions:
-
Fork the repository.
-
Checkout a topic branch from the
developmentbranch. -
Make sure the tests are passing.
-
Create a pull request against the
developmentbranch.
A more detailed description can be found here: https://github.com/noi-techpark/documentation/blob/master/contributors.md.
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-commitThen install the pre-commit hook via the config file by running:
pre-commit install