1# Updating libraries
2
3## update OpenLayers
4
5### full build
6This will get the full/legacy build of OpenLayers. See https://openlayers.org/download/
7
8```shell
9cd ol
10export OL_VERSION=v10.4.0
11wget https://github.com/openlayers/openlayers/releases/download/$OL_VERSION/$OL_VERSION-dist.zip
12unzip -jo $OL_VERSION-dist.zip  dist/* ol.css ol.css.map
13rm $OL_VERSION-dist.zip
14```
15
16### custom OpenLayers build
17
18A slightly more complicated build process is required to get an optimized-full-size build of OpenLayers.
19
20```shell
21cd ol
22rm -rf openlayers
23export OL_VERSION=v10.4.0
24git clone https://github.com/openlayers/openlayers.git
25cd openlayers
26git checkout -b $OL_VERSION-custom $OL_VERSION
27npm install
28# patch package.json to remove puppeteer (not supported on OpenBSD)
29npm uninstall puppeteer
30# patch generate-info.js to exclude some parts
31cp ../generate-info.js.diff .
32git apply generate-info.js.diff
33rm -rf build/
34npm run build-index
35npx rollup --config config/rollup-full-build.js
36npx cleancss --source-map src/ol/ol.css -o build/full/ol.css
37cp build/full/*.* ../
38cd ..
39rm -rf openlayers
40```
41
42## update LayerSwitcher
43
44see https://github.com/walkermatt/ol-layerswitcher#js
45
46```shell
47cd ol
48export SWITCHER_VERSION=4.1.2
49wget "https://unpkg.com/ol-layerswitcher@$SWITCHER_VERSION" -O ol-layerswitcher.js
50wget "https://unpkg.com/ol-layerswitcher@$SWITCHER_VERSION/dist/ol-layerswitcher.css" -O ol-layerswitcher.css
51```
52