JSFiddle - React, Tailwind, and code Playground
Testing bug fix in getBounds method for circles in Leaflet 1.0.0-rc1
HTML
<link rel="stylesheet" href="//cdn.leafletjs.com/leaflet/v1.0.0-rc.1/leaflet.css">
<script src="//dl.dropbox.com/s/iddmprlh0ihsvv5/leaflet-1rc1-src-modified.js"></script>
<div id="map"></div>
CSS
html,
body,
#map {
height: 100%;
width: 100%;
padding: 0px;
margin: 0px;
}
JavaScript
var map = L.map('map').setView([0,0], 0);
ATTR = '© <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a> | ' +
'© <a href="http://cartodb.com/attributions">CartoDB</a>';
CDB_URL = 'http://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png';
L.tileLayer(CDB_URL, {
attribution: ATTR
}).addTo(map);
map.on('click', function(e) {
var circ = L.circle(e.latlng, {radius:10000}).addTo(map);
var bounds = circ.getBounds();
var rect = L.rectangle(bounds).addTo(map);
var width = map.distance([e.latlng.lat, bounds.getWest()], [e.latlng.lat, bounds.getEast()]);
console.log('Width of bounds: ' + width);
});