1.0.1 • Published 11 months ago

@geoblocks/ol-maplibre-layer v1.0.1

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
11 months ago

MapLibre OpenLayers layer

Render a MapLibre GL JS map as an OpenLayers layer.

Installation

npm i @geoblocks/ol-maplibre-layer

OpenLayers and MapLibre GL JS are peer dependencies, so you need to install them too.

npm i ol maplibre-gl

Code example

import MapLibreLayer from '@geoblocks/ol-maplibre-layer';

const layer = new MapLibreLayer({
  opacity: 0.7,
  mapLibreOptions: {
    style: 'https://www.example.com/path/to/style.json',
  },
});

// ...
map.addLayer(layer);

All the properties passed to the construction (except mapLibreOptions) are used to create the OpenLayers layer. mapLibreOptions is used to create the MapLibre map.

The MapLibreLayer exposes the underlying MapLibre map as public property, so you can use it to interact with the map.

layer.maplibreMap.setStyle('https://www.example.com/path/to/other/style.json');

Online doc and demos

Local development

For local development we use a few demos.

npm install
npm run start
open http://localhost:1234

Publish a new version to npm

The source is transpiled to standard ES modules and published on npm.

# update CHANGES.md
npm version patch
npm publish
git push --tags origin master
npm run gh-pages
1.0.1

11 months ago

1.0.0

1 year ago

0.1.3

1 year ago

0.1.2

2 years ago

0.1.0

2 years ago

0.1.1

2 years ago

0.1.0-rc0

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.3

3 years ago

0.0.4

3 years ago

0.0.2

3 years ago

0.0.1

4 years ago