Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

Custom Element with Leaflet not rendering correctly after client-side navigation in SvelteKit

$
0
0

I built a custom element using Leaflet that renders all the elements on the map by simply passing a JSON object.

The map works perfectly on a full page reload, but when navigating between different pages (using client-side navigation in SvelteKit), and then returning to the map, the elements don't display, and a Leaflet error is thrown. It seems like the map is not being reinitialized properly after navigation.

What could be causing this issue, and how can I ensure the map is correctly initialized when navigating back to the page?

I tried different SvelteKit methods for re-rendering the component or reloading the script every time I navigate to the page, but none of these attempts worked.

SSR is off.


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>