문제

I have a few WMS layers generated by geoserver (data from postgis), in leaflet I'm creating layers using both L.tileLayer.wms and L.tileLayer. In both cases I have the same result - there is the same data on each tile. The data is repeated on each tile. The data is not on the correct coordinates. Hard to explain, you can look at enclosed printscreen here.

My code look like this:

var sondy = new L.tileLayer.wms('http://localhost:8080/geoserver/archeo/wms?bbox=-556182.167458477,-1031638.88186088,-556085.240458477,-1031526.68186088&width=442&height=512', { 
  version: '1.1.0',
  layers: 'archeo:sondy_5514>4326',
  format: 'image/svg+xml',
  crs: L.CRS.EPSG4326,
  maxZoom: 21,
  transparent: true,
  attribution: 'Map data © Archeo'
  });

var lokalita = new L.tileLayer('http://localhost:8080/geoserver/archeo/wms?service=WMS&version=1.1.0&request=GetMap&layers=archeo:lokalita%3E4326&styles=&bbox=17.001919195719633,50.3879944052749,17.00420450498308,50.38958109165828&width=512&height=355&srs=EPSG:4326&format=image%2Fsvg%2Bxml', { 
  layer: 'lokalita',
  opacity: 1,
  maxZoom: 21,
  transparent: true,
  attribution: 'Map data © Archeo'
  });

Do you have an idea where is the problem? Is it in geoserver or leaflet code?

Thanks in advance, Markéta

도움이 되었습니까?

해결책

Ciao, I am not an expert with leaflet but to me it looks like something's wrong in how you initialize your layers (for sure the WMS one, why you put the bbox in the source URL??):

Check this link: http://leafletjs.com/reference.html#tilelayer-wms

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top