The IoT Registry offers transparency to citizens, visitors and entrepreneurs by providing an online registry of IoT devices. Learn more
This application is developed part of the SCORE project (Smart Cities + Open Data Re-use). SCORE aims to increase efficiency and quality of public services in cities through smart and open data-driven solutions. The SCORE partners develop innovative solutions based on open data. We focus on sharing insights and methodologies for developing better public services. Learn more
This project was bootstrapped with Create React App. It is based on a previous repository that was bootstrapped with React Boilerplate. We decided to change to a different bootstrapping platform for a multitude of reasons. With the main ones being webpack build size, security vulnerabilities and ease of updating.
This env variable sets the link to a collection made using APIAPI that returns a list of json's in the format of the Device
class found at src/services/classes/Device.js
This tool takes different API sources and returns a customisable format.
This env sets the path to the geolocation suggestion API. This API take a free form search string. May contain community names, sub-community area names, zip codes, street names, house numbers or parts thereof. A minimum of two characters is required and returns a list of suggestions based on the provided string. This is used in the src/services/api/Geocoder.js
service. This api get called by the src/containers/Geocoder
component.
This env sets the path to the geolocation location API. This API takes a suggestion that the user entered and tries to find a location that matches it as good possible and then returns a location object that contains coordinates that the get used to move the viewport and place the searchmarker.
This env sets the root adress of the map wmts API.
<WMTSTileLayer
url={process.env.REACT_APP_MAP_ROOT}
layer="SG-E-Stadsplan:Stadsplan"
tilematrixSet="SG-WEB MERCATOR"
format="image/png"
/>
This is a parameter that gets added to the end of the suggestion Search string to limit results to the current City the app is configured for. If it is not set the search will not filter based on the city.
the rest are self explanatory, for the zoom levels refer to the leaflet documentation
REACT_APP_MAP_MAX_ZOOM=19
REACT_APP_MAP_DEFAULT_ZOOM=14
REACT_APP_MAP_CENTER_LATITUDE=51.0543
REACT_APP_MAP_CENTER_LONGITUDE=3.7174
During development we found you often had data that wasn't hosted on an API but was only available in Excel sheets. So we added a feature that lets you add static csv files that will be loaded alongside the API sources.
Your CSV file can contain as many headers
as you want. But only the following headers will be displayed by default. If a header
is missing, its field won't be displayed in the marker card (see image below).
- title
- category
- This will be the category on the left.
- type
- This specifies the catergory displayed on the right. Both category and type are also used for the filtering in the
legend
component.
- This specifies the catergory displayed on the right. Both category and type are also used for the filtering in the
- dataprocessing
- retention
- datacontactorg
- link
- latitude
- The application is smart enough to handle the conversion from excel to csv. For example if the latitude value gets changed to
"51,367,895"
it will automatically be converted to51.367895
- The application is smart enough to handle the conversion from excel to csv. For example if the latitude value gets changed to
- longitude
Adding csv files is very easy, just add a new file that has the correct headers (not case sensitive) to the folder src/csv
. The application automatically loads all files in this folder.
An excerpt of the ANPR camera csv that is formatted correctly.
category,type,title,latitude,longitude,dataprocessing,retention,personaldata,contactorg,linklabel,link
Camera,Nummerplaatherkenning,Toegangscontrole autovrij gebied - Sint-Michielsplein,51.053752,3.718900,"In het kader van het circulatieplan controleren slimme camera’s de autonummerplaten. Dit in de autovrije gebieden en een aantal doorgangsverboden (de knippen).
","5 maand voor niet-overtredingen, 5 jaar voor overtredingen",Ja,Mobiliteitsbedrijf Stad Gent,Meer over de dataverwerking,https://verwerkingsregister.stad.gent/verwerking/ea13d3f8-e79a-e811-80dd-adca587e5ac2
Camera,Nummerplaatherkenning,Toegangscontrole autovrij gebied - Drabstraat,51.055350,3.718790,"In het kader van het circulatieplan controleren slimme camera’s de autonummerplaten. Dit in de autovrije gebieden en een aantal doorgangsverboden (de knippen).
","5 maand voor niet-overtredingen, 5 jaar voor overtredingen",Ja,Mobiliteitsbedrijf Stad Gent,Meer over de dataverwerking,https://verwerkingsregister.stad.gent/verwerking/ea13d3f8-e79a-e811-80dd-adca587e5ac2
The
Device
class that gets used internally, additional fields in your api or csv will also be added to this class upon creation.
class Device {
constructor(
id,
title,
personalData,
category,
type,
contactorg,
dataprocessing,
link,
retention,
latitude,
longitude
)
}
An example of a record in the API, the application expects a list of these records as a return value.
{
id: "769b8248e90daa6cd8d90e0a96fa38c80b100682",
title: "Real Time data MUV Monitoring Stations",
category: "Sensor",
type: "Meteo",
dataowner: "Stad Gent - Dienst Data & Informatie",
dataprocessing: "Real-time (5min) data van de verschillende Monitoring Stations verspreid in en rond Gent. Deze Monitoring stations zijn geplaatst in het kader van het Europese MUV project.",
link: "https://data.stad.gent/explore/dataset/real-time-data-muv-monitoring-stations-recentste-waarde/information/",
longitude: 3.751784,
latitude: 51.057832
}
The card marker component can be found at src/container/LeafletMarker/index.js
. You can customize the values that are shown in the marker in the render function. If a value is not present in the data of the device, either undefined or null, the label is not shown. If the device has a populated field device.linklabel
the default linklabel will be overwritten but that value.
const dataProcessingLabel = t('dataprocessing')
const personalDataLabel = t('personaldata')
const retentionLabel = t('retention')
const contactLabel = t('contactorg')
const linkLabel = t('linkLabel')
<TextBlock label={dataProcessingLabel} content={device.dataprocessing} />
<TextBlock label={personalDataLabel} content={device.personalData} />
<TextBlock label={retentionLabel} content={device.retention} />
<TextBlock label={contactLabel} content={device.contactorg} />
<LinkBlock device={device} linkLabel={linkLabel} />
This component shows all the categories and their respective types, if a custom type icon exists it will be used here and on the map as marker (refer to the icon section for more information about icons). Clicking the category will hide the types.
This list is generated based on the category
and type
fields of the Device
class. The icons are linked by the the getTypeMarker
found in src/services/api/marker.js
. Changing the value of category or type in the API will also update it here.
If you want your categories or types to have an icon, that icon must be placed in the src/images
folder. The src/icons
folder is used for UI icons. Currently the application was build to use .png
files but it should be possible to change a few lines to have it work with different file types.
When you add new icons they have to be lowercase and end with .png and have the exact same spelling as your category/type. The category or type does not have to be lowercase.
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
Note: this is a one-way operation. Once you eject
, you can’t go back!
If you aren’t satisfied with the build tool and configuration choices, you can eject
at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject
will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use eject
. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
SCORE is a project co-funded by the Interreg North Sea Region Programme 2014-2020.