JSFiddle - React, Tailwind, and code Playground
by Leo
HTML
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css">
<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
<div id="map" style="height: 400px"></div>
JavaScript
var geojson = {
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [2.63671875, 65.87472467098549]
}
}, {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [-14.765625, -3.864254615721396]
}
}, {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [4.74609375, 45.706179285330855]
}
}, {
"type": "Feature",
"properties": {},
"geometry": {
"type": "LineString",
"coordinates": [
[-13.18359375, 46.437856895024225],
[-8.96484375, 49.83798245308484],
[-5.09765625, 43.83452678223684],
[-30.41015625, 38.272688535980976],
[-32.34375, 55.87531083569679],
[-42.01171875, 54.97761367069625],
[-62.22656249999999, 30.751277776257812]
]
}
}, {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[-13.0078125, 12.039320557540584],
[-13.0078125, 39.36827914916014],
[16.5234375, 29.99300228455108],
[9.4921875, 12.039320557540584],
[-13.0078125, 12.039320557540584]
]
]
}
}]
};
L.stamp = function (obj) {
console.log(obj);
return L.Util.stamp(obj);
};
var map = L.map('map').setView([53, 2], 2);
L.control.layers({
'OSM': L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map)
}, {
'Circle': L.circle([53, 4], 111111),
'Polygon': L.polygon(
[
...