Leaflet + Polymer 2 Map Loading with Distorted Tile However Works with Non-Polymer Code

Leaflet + Polymer 2 map loading with distorted tile however works with non-polymer code

Leaflet CSS styles are not applied to shadow DOM elements.

To make it work you need to add leaflet.css here:

// ...
<link type="text/css" rel="stylesheet" href="https://unpkg.com/leaflet@1.3.4/dist/leaflet.css">

<p>I'm a shadow DOM child element of x-foo.</p>
// ...

Working example:
https://plnkr.co/edit/CJUlwUnBezum9jgt93uF?p=preview

Leaflet drawing tiles disjointly

This sounds like a symptom of missing Leaflet CSS file, or incorrect version of that file.



Related Topics



Leave a reply



Submit