This module adds elevation control to mapbox-gl.
npm i @watergis/mapbox-gl-elevation --saveTry codesandbox.
See demo.
import MapboxElevationControl from "@watergis/mapbox-gl-elevation";
import '@watergis/mapbox-gl-elevation/css/styles.css';
import mapboxgl from 'mapbox-gl';
const map = new mapboxgl.Map();
map.addControl(new MapboxElevationControl(
'https://wasac.github.io/rw-terrain/tiles/{z}/{x}/{y}.png',
{
font: ['Roboto Medium'],
fontSize: 12,
fontHalo: 1,
mainColor: '#263238',
haloColor: '#fff',
}
), 'top-right');
});npm run lint # check styling of source code
npm run lint:fix # fix styling by eslint
npm run devopen http://localhost:8080.
If there are any changes on source code, it will be reflected automatically.
npm run buildThe modules will be generated under dist folder.
npm run deployIt will deploy files under example folder to gh-pages.
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.This Mapbox GL Elevation Control is still under development. so most welcome any feedbacks and pull request to this repository.
