kartena / Proj4Leaflet

Smooth Proj4js integration with Leaflet.
http://kartena.github.io/Proj4Leaflet/
BSD 2-Clause "Simplified" License
590 stars 173 forks source link

Geojson layer isn't shown after removeControls and layers. #156

Closed aanndd closed 6 years ago

aanndd commented 6 years ago

If I remove some controls and proj4leaflet geojson layers and then add them again, the geojson layers don't show up. If I look at the image overlay in the DOM, the size and place is wrong for the overlay. If I resize the window, then the geojson layer start working again.

/Anders

PS Thanks for the library!

perliedman commented 6 years ago

Hi Anders, I think we need some more details on what you're doing - from your description, it doesn't sound related to Proj4Leaflet, but it's hard to tell without seeing what your code is actually doing.

Can you provide a running example of the issue you're seeing?

aanndd commented 6 years ago

Hi Per! I saw that the overlay is handled in the library and therefore I thought it might be something with it or a workaround to reset it. I now tried to make a simple example, but can't reproduce the error in that, so it is probably something else with the different controls I have. The problem can be seen in kartbild.com. If I "load" my own data, then switch to split screen and switch back, the loaded data isn't shown. I probably have to look more in detail about whats going on. Thanks for the answer, and sorry for not supplying more detailed information. Best regards Anders

perliedman commented 6 years ago

@aanndd woha, nice site! Love these historic map images and really cool to see a site built around them.

I'll try to dig into what you're saying once I get some free time...

aanndd commented 6 years ago

Thanks! I looked at it again and tried the standard L.geoJSON and get the same problem so its not in your library. (There are no width and height attribute in the svg. If I set them, then the overlay is shown correct.) Best regards Anders

aanndd commented 6 years ago

Upgraded to latest leaflet version and now it works. :-)