Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
180 views
in Technique[技术] by (71.8m points)

javascript - Problem of tiling with GeoWebCache: most tiles are missing

I set up a PostGIS database that I added in GeoServer via a parameterized SQL view. I used Leaflet to display this layer via wms.

It worked fine until I add GeoWebCache using the url "/geoserver/gwc/service/wms" instead of "/geoserver/wms". I can still see my polygons when I'm at the minimal zoom. But then when I zoom I see only a red polygon and a half of a green polygon and if I zoom again I see only the red polygon. You can see these 3 states on the images below:

3 different zooms on my map

I guess this is a problem of tiling: I get the minimal tiles and also some tiles around the red polygon for further zooms but for some reason it seems that the other tiles are not sent.

Here is the code I use to get my wms layer with leaflet:

geoJSONlayer = L.tileLayer.wms("/geoserver/gwc/service/wms", {
    layers: 'cartowiki:choix',
    format: 'image/png',
    transparent: true,
    viewparams: 'year:'+(annee+3000)
}).addTo(map);

geoJSONlayer.addTo(map);

Do you have an idea of the problem here ?

Thanks in advance,

question from:https://stackoverflow.com/questions/65903279/problem-of-tiling-with-geowebcache-most-tiles-are-missing

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The bounding box was the problem indeed. In Geoserver, I had to modify the properties of the layer in 2 places :

  • I clicked 'Compute from SRS bounds' and then 'Compute from native bounds' in the Bounding Boxes part of the Data section

  • I erased and created again the available gridsets in the Tile Caching section so that the grid subset bounds would update with the new Bounding Boxes

I hope it can help someone in the future!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...