xref: /plugin/openlayersmap/ol/README.md (revision f204b8ca21a3ff1a5b655b65aceab085168cc9d8)
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=v8.2.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-fot-size build of OpenLayers.
19
20```shell
21cd ol
22rm -rf openlayers
23export OL_VERSION=v8.2.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/*.* ../
38```
39
40## update LayerSwitcher
41
42see https://github.com/walkermatt/ol-layerswitcher#js
43
44```shell
45cd ol
46export SWITCHER_VERSION=4.1.1
47wget "https://unpkg.com/ol-layerswitcher@$SWITCHER_VERSION" -O ol-layerswitcher.js
48wget "https://unpkg.com/ol-layerswitcher@$SWITCHER_VERSION/dist/ol-layerswitcher.css" -O ol-layerswitcher.css
49```
50