Reader
Reader

Reputation: 15

I'm having problems showing leaflet map in a bootstrap tab

I'm trying to put a leaflet map on a bootstrap tab, but it's not working. Not showing at all or missing tiles and in the wrong position .

Does anyone have an idea how to fix that?

This is an example of the problem: missing tiles

This is my code: https://gist.github.com/h3kr/991ac0ee5a88d0cecba27e91c886675e

Upvotes: 0

Views: 1522

Answers (1)

IvanSanchez
IvanSanchez

Reputation: 19069

You forgot to include the CSS file for Leaflet.

Let me quote the Leaflet docs:

The latest stable Leaflet release is hosted on a CDN — to start using it straight away, place this in the head of your HTML code:

<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>

Upvotes: 2

Related Questions