3

I have published a wms using the QGIS Cloud and on top of it I am overlaying the same data (countries of Europe), using GeoJSON. Have a look at an example here: http://jsfiddle.net/j21kh7ao/
At a low zoom level, the geometries don't overlap 100%. When zooming in, the differences start to disappear.

Any idea why this happens? To me it seems Leaflet is using some zoom based generalization for the geojson, could it be possible?

8

Leaflet's GeoJSON uses by default a smoothing factor which eliminates less important points. Pass {smoothFactor: 0} to L.geoJson as an option to achieve a more appropriate overlap.

1

According to the developer of Leaflet, there is some generalisation going on. So that's the cause. I'm not sure if you can turn it off or not, sorry.

  • thank you for your answer, that's what I was curious about. Setting a bigger weight for the stroke will hide the small gaps caused by the generalization... – Raluca Apr 22 '15 at 7:36
0

I can see that the app in Fiddle is working well.However, the effect you mentioned is visible but I think that depends on the render speed of the layers onto the map.When zooming in the layers are all Ok. I don't think thats a problem to worry about

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.