Skip to content

ActDev - Active travel provision and potential in planned and proposed development sites: UI

License

Notifications You must be signed in to change notification settings

cyipt/actdev-ui

Repository files navigation

ActDev

Active travel provision and potential in planned and proposed development sites.

Installation

This assumes you're running this on Apache.

# Enter your webserver's files area
cd /var/www/

# Clone the repo
git clone https://github.com/cyipt/actdev-ui
cd actdev-ui

# Clone the library within the repo
yarn install

# Add an Apache configuration
sudo cp -pr .apache-vhost.conf.template /etc/apache/sites-available/actdev.conf
sudo a2ensite actdev
sudo service apache2 restart

# Add local host
sudo sh -c "echo '127.0.0.1 actdev' >> /etc/hosts"

# Copy the config template and add API keys
cp .config.js.template .config.js

# Use a text editor of your choice to add the API keys to the config file

# Open your web browser at http://actdev/

Development guidelines

The structure of the code is simply a file /js/actdev.js (launched in /index.html) which simply:

  1. Declaratively defines the overall map settings, e.g. start position, default basemap, API keys, etc.
  2. Declaratively defines each layer and their properties, e.g. data sources, styling, etc.
  3. Loads the underlying library, Mapboxgljs.LayerViewer, supplying the settings and layer definitions.

The LayerViewer library does all the heavy lifting and aims to provide a very featureful, flexible and asyncronous handling of multiple data layers, while not requiring large amounts of data to be loaded up-front as static files.

To make changes/additions to layers, amend /js/actdev.js, which contains the layer declarations.

The layer definitions can include any of the properties supported by the underlying library.

To add a new layer, simply:

  1. In /js/actdev.js, add the new layer and its parameters
  2. In the layout file, /index.html, add in a new menu entry in the menu <nav> section
  3. In the layout file, /index.html, add a panel in <div id="sections"> which provides some explanation

To amend an existing layer, simply:

  1. In /js/actdev.js, update the parameters required

License

GPL3.

Copyright

University of Leeds and CycleStreets Ltd, 2021.