Using the BRC Atlas Library
Explore the source of this page and examine the code comments to see how it works. Included on this page:
- Creating a simple UK atlas (SVG) map
- Changing the island inset style
- Changing the map colours and styles
- Downloading map images and data
Show a UK distribution map from a CSV file
Note the default inset control (gear icon) in the margin-bottom right of the map which is shown by default. The user can modify the way some islands are handled with this.
Modify map colours & styles
In this example the inset control is removed and the map is configured to show both the Channel Islands and northern islands as insets. We also changed the colours and styles used to display elements.
Download map image and data
In this example were adding some buttons to download images of the currently displayed map and download the dots as geojson and CSV files.
A note on the data used here
A CSV file is specified in the 'data' sub-folder of the folder containing this page. An extract is reproduced below. The 'Standard hectad' accessor expects a CSV file with five columns as show below:
- hectad: the grid reference of a hectad. The file can contain a mixture of hectad grid references for Britain, Ireland and the Channel Islands.
- colour: the html colour with which to display the hectad. Colours can be specified using standard HTML colour names (e.g. 'indianred') or hex codes (e.g. #CD5C5C).
- shape: permitted values are: circle, square, diamond, triangle-up, triangle-down.
- opacity: a number between 0 and 1.
- size: a number between 0 and 1.
In the example file, all the hectads are specified, with the same colour, shape, size and opacity, but you can specify these on a per/hectad basis.
D22,circle,black,0.8,1 H05,circle,black,0.8,1 HU43,circle,black,0.8,1 NS97,circle,black,0.8,1 NT14,circle,black,0.8,1 WA60,circle,black,0.8,1 WV27,circle,black,0.8,1