6

I am trying to display a heatmap generated with geoserver on my map using the L.tileLayer.WMS class from Leaflet, but the tiles do not fit well together.

enter image description here

Do you have any idea how to fix it?

  • 1
    Does it show up correctly in the geoserver layer preview? – neogeomat Jan 4 '14 at 11:14
  • I can preview my points but I don't find how to preview with the sld (my heatmap) – Frederic Le Feurmou Jan 4 '14 at 11:20
  • Ok I found how to do, here is a screenshot of my preview : diigo.com/item/image/3zsmm/njas It seems ok – Frederic Le Feurmou Jan 4 '14 at 13:11
  • 1
    I don't use geoserver but it seems to me that the problem lies in some tiling settings that are in conflict with your wms or leaflet itself. I'd better if you post some code. – Gery Jan 4 '14 at 21:57
  • can you try on the geoserver preview to ask for a tiled view? expand the options (button on top of the directions pad) and ask for the tiles (see screenshot). Does it renders equal to "non-tiled" layer? – Jorge Sanz Jan 4 '14 at 22:21
5

I've had this issue before, it looks like you have done exactly what I did.

The GeoServer WPS example heat map doesn't support tiles, so what Gery said is correct you need to set tiled=false.

I had the same problem in OpenLayers, so it isn't a Leaflet issue.

2

Indeed it was a tile problem, as said in the geoserver doc

Rendering transformations may not work correctly in tiled mode, unless they have been specifically written to accomodate it.

but setting tiled to false didn't work.

But I found this custom leaflet class which worked for me : http://bl.ocks.org/ismyrnow/5415445

  • 1
    Where does one set tiled=false? – ragnvald Jun 11 '15 at 19:36
1

In the case the code of the WMS class itself would be the problem, you can check this nice heatmap example by Patrick Wied to see if you find a relevant difference with your code: http://www.patrick-wied.at/static/heatmapjs/example-heatmap-leaflet.html

  • 1
    I already tried this great API and it worked well but I changed for a server side computed heatmap for performance reasons. – Frederic Le Feurmou Jan 5 '14 at 11:00
  • that means that geoserver is complicating things here, does it have any log error or something like that from where some debugging can be done? what does firebug (net tab) says? – Gery Jan 5 '14 at 12:51
  • Here is my Geoserver query log : justpaste.it/e07d No log error on the client side – Frederic Le Feurmou Jan 5 '14 at 16:03
  • 2
    looks to me that you need to change things to, e.g.: tiled=false, and check the projection stuff in your map as well as the tile size (not likely but give it a try). If your basemaps are google et al (basemaps in 900913) and your tiles in 4326, things are messed up because of that. – Gery Jan 5 '14 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.