映射Libre OpenLayers 层
显示 a MapLibre GL 联合来文 地图为 打开标签 层.
安装
npm i @geoblocks/ol-maplibre-layer
OpenLayers和MapLibre GL JS是同级依赖,所以你也需要安装它们.
npm i ol maplibre-gl
代码示例
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);
所有地产都转给建筑(但 mapLibreOptions用于创建 OpenLayers 层。 。 。 .
mapLibreOptions 用于创建 地图Libre地图。 。 。 .
MapLibreLayer将基础的MapLibre地图暴露为公共财产,因此可以使用它来与地图进行互动.
layer.maplibreMap.setStyle('https://www.example.com/path/to/other/style.json');
在线医生和演示
解决问题
使用 MapLibre-GL v6, 你必须手动设置工人,读取 MapLibre v6 安装。 。 。 .
地方发展
为了当地的发展,我们使用一些演示.
npm install
npm run start
open http://localhost:1234
发布新版本到 npm
该源被转录到标准ES模块并被发布在npm上.
# update CHANGES.md
npm version patch
npm publish
git push --tags origin master
npm run gh-pages