Using the BRC Atlas Library
Show an Irish distribution map from a CSV file
This example demonstrates creation of an atlas map for a region of the British Ilse for which boundary, grid and transformation information does not exists as a standard asset in the library. In this case, we are displaying a hectad map for Ireland and the map is shown on the Irish projection.
For an explanation of the code that instantiates a standard map and displays, see example-1.html. This example builds on that one.
Create the map in the div element with the id 'map' with the necessary configuration options. See text below for an explanation of them.
var map = brcatlas.svgMap({
id: "map",
mapTypesKey: 'Standard hectad',
transOptsKey: 'Ire1',
transOptsSel: {
Ire1: {
id: 'Ire1',
caption: 'Island of Ireland',
bounds: {
xmin: 18000,
ymin: 12000,
xmax: 380000,
ymax: 470000
},
},
},
boundaryGjson: './ireland-29903.geojson',
gridGjson: './ireland-grid-29903.geojson',
proj: "ir",
})
map.setIdentfier('./example-irish-hectads-1.csv')
map.redrawMap()
- transOptsKey: this specifies the key of the transformation option that is to be selected from transformation option objects defined by transOptsSel.
- transOptsSel: has one or more properties corresponding to transformation option objects. In this case only a single transformation is defined. The bounds specify a suitable bounding box for the island of Ireland which must use coordinates in the same projection used for the geojson files used to define the boundary and/or grids. In this case we are using data projected in the Irish Grid TM75 (EPSG code 29903).
- boundaryGjson: a geoJson file which specifies the geographical boundary of the island of Ireland. This is projected in the Irish Grid system (EPSG code 29903).
- gridGjson: a geoJson file which specifies some grid lines for the island of Ireland - 100 km grid in this case. This is projected in the Irish Grid system (EPSG code 29903).
- proj: this is used to specify the projection that will be used to render the altas 'dots'. It requires a two letter code corresponding one of the projections known to the BRC Atlas library ('gb', 'ir' or 'ci'). Here, of course, we use 'ir' corresponding to the Irish Grid System.
We use map.setIdentfier to identify some data from a CSV file that contains Irish hectad grid references. We are using the standard hectad data accessor function Standard hectad. Finally we draw the map with map.redrawMap.