JSPM

@watergis/maplibre-gl-elevation

1.0.9
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q66278F
  • License MIT

This module adds elevation control to maplibre-gl.

Package Exports

  • @watergis/maplibre-gl-elevation
  • @watergis/maplibre-gl-elevation/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@watergis/maplibre-gl-elevation) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

maplibre-gl-elevation

GitHub

This module adds elevation control to maplibre-gl. It was forked from mapbox-gl-elevation.

Installation:

npm i @watergis/maplibre-gl-elevation --save

Demo:

Try codesandbox.

See demo.

demo

Usage:

import MaplibreElevationControl from "@watergis/maplibre-gl-elevation";
import '@watergis/maplibre-gl-elevation/css/styles.css';
import maplibregl from 'maplibre-gl';

const map = new maplibregl.Map();
map.addControl(new MaplibreElevationControl(
        'https://wasac.github.io/rw-terrain/tiles/{z}/{x}/{y}.png',
        { 
          font: ['Roboto Medium'],
          fontSize: 12,
          fontHalo: 1,
          mainColor: '#263238',
          haloColor: '#fff',
        }
    ), 'top-right');
});

Development:

npm run lint # check styling of source code
npm run lint:fix # fix styling by eslint
npm run dev

open http://localhost:8080.

If there are any changes on source code, it will be reflected automatically.

Build package:

npm run build

The modules will be generated under dist folder.

Deploy to Github pages

npm run deploy

It will deploy files under example folder to gh-pages.

How to release

npm version patch # it increase patch version 0.0.X
npm version minor # it increase minor version 0.x.0
npm version major # it increase major version x.0.0
git push origin main --tag
# release CI will create draft release in Github pages, then publish it if it is ready.
# publish CI will deploy npmjs and Github Packages.

Contribution

This Maplibre GL Elevation Control is still under development. so most welcome any feedbacks and pull request to this repository.