I am trying to load WMS layer using leaflet from USGS WMS server but I am getting an empty image. I have gone through Loading WMS layer from external server in Leaflet? link but it doesn't solve my issue.
My code:
var map = L.map('map').setView([47.608013,-122.335167], 5);
L.tileLayer.wms(USGS server link,
{
layers: '0',
format: 'image/png',
version: '1.3.0',
transparent: true,
continuousWorld: true,
attribution: "",
tiled:true
}).addTo(map);
I even tried changing version to 1.1.1, removed continousWorld: true etc.(tried almost everything). latitude and longitude that I used is Seattle's. Other examples of WMS Leaflet are working for me. The URL it is using to get the image is:
<img src="<wms server>?request=GetCapabilities&service=WMS&SERVICE=WMS&REQUEST=GetMap&VERSION=1.3.0&LAYERS=0&STYLES=&FORMAT=image%2Fpng&TRANSPARENT=true&HEIGHT=256&WIDTH=256&CONTINUOUSWORLD=true&TILED=true&CRS=EPSG%3A3857&BBOX=-13775786.985667603,6261721.35712164,-12523442.714243276,7514065.628545966" style="height: 256px; width: 256px; left: 270px; top: 17px;">
The USGS WMS server is working fine in QGIS tool.