Package Exports
- leaflet-wms-header
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 (leaflet-wms-header) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
leaflet-wms-header
Custom headers on Leaflet TileLayer WMS. It's an easy plugin that allow to set custom header for WMS interface.
Based on https://github.com/Leaflet/Leaflet/issues/2091#issuecomment-302706529.
Installation
$ npm install leaflet-wms-header --saveJS Usage
var wmsLayer = L.TileLayer.wmsHeader(
'https://demo.boundlessgeo.com/geoserver/ows?',
{
layers: 'ne:ne',
format: 'image/png',
transparent: true,
},
[
{ header: 'Authorization', value: 'JWT ' + MYAUTHTOKEN },
{ header: 'content-type', value: 'text/plain'},
]
).addTo(map);Typescript Usage
let wmsLayer: L.TileLayer.WMSHeader = L.TileLayer.wmsHeader(
'https://demo.boundlessgeo.com/geoserver/ows?',
{
layers: layers,
format: 'image/png',
transparent: true,
}, [
{ header: 'Authorization', value: 'JWT ' + MYAUTHTOKEN },
{ header: 'content-type', value: 'text/plain'},
]
).addTo(map);