JSFiddle - React, Tailwind, and code Playground

by alfannas

HTML

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

CSS

#map{width:100%;height:300px;}

JavaScript

// Create the map
// initialize the map on the "map" div with a given center and zoom
var map = L.map('map', {
    center: [-2.623069,118.3901453],
    zoom: 4
});

// Set up the OSM layer
L.tileLayer(
    'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', 
    {maxZoom: 18}).addTo(map);

// add a marker in the given location