JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://cdn.leafletjs.com/leaflet-0.5.1/leaflet.js"></script>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5.1/leaflet.css">
<div id="map"></div>
CSS
html, body, #map {
padding: 0;
margin: 0;
height: 100%;
}
JavaScript
L.Site = {};
L.Site.TileLayer = L.TileLayer.extend({
statics: {
OPTIONS: {
minZoom: 0,
maxZoom: 18,
attribution: 'Map data © OpenStreetMap contributors'
},
TILEURL: 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'
},
initialize: function (options) {
this.options = L.Util.extend({}, this.options, L.Site.TileLayer.OPTIONS, options);
this._url = L.Site.TileLayer.TILEURL;
},
});
var map = new L.Map('map');
var tilelayer = new L.Site.TileLayer({
foo: 'bar'
});
map.addLayer(tilelayer);
map.setView(new L.LatLng(19.4117088, -99.1805968),16);
console.log(tilelayer);