Skip to content

Bootstrap isolation

Raitis Berzins edited this page Nov 13, 2019 · 4 revisions

Often bootstrap styling needs to be isolated just in hslayers map not to polute the containing website with unnecessary styles, which can conflict with other css frameworks. To achieve this Hslayers layout is contained in

We need to generate a special bootstrap.isolated.css file based on the original bootstrap.css where every selector is prefixed with .bootstrap-iso . This can be done with bootstrap-isolate.js contained in scripts directory, which can be run with

node node_modules/hslayers-ng/scripts/bootstrap-isolate.js

if hslayers-ng is dependency of your app or npm run isolate-bootstrap if you have cloned hslayers-ng repo directly.

In app.js we have to set config: {useIsolatedBootstrap: true} to tell hslayers to use this isolated version of bootstrap

Clone this wiki locally