Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can we add a request header in Leaflet tile layer wms request

Tags:

leaflet

I want to make a wms request using L.tileLayer.wms, Is there a way to add a request header to the request for authorization purposes? If not what would be a good possible workaround?

like image 551
Ramesh Rajagopalan Avatar asked May 12 '17 20:05

Ramesh Rajagopalan


People also ask

What is tile layer in leaflet?

Used to load and display tile layers on the map, implements ILayer interface.

What is WMS tile layer?

TileLayer. WMS layer, provide the base WMS URL, and specify whatever WMS options you need. The base WMS URL is simply the GetCapabilities URL, without any parameters, like so: http://ows.mundialis.de/services/service?


1 Answers

you can use leaflet-wms-header plugin https://github.com/ticinum-aerospace/leaflet-wms-header or try to create a custom wms layer as in this example https://github.com/ticinum-aerospace/leaflet-wms-header/blob/master/index.js

like image 196
nilesh15 Avatar answered Sep 28 '22 05:09

nilesh15