JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css"/>
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.ie.css" />
<![endif]-->
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script>
<div id="map" style="width:800px; height:600px;"></div>
JavaScript
// LIBRARY SCRIPT
var a = [];
L.Map = L.Map.extend({
openPopup: function (popup, latlng, options) {
//this.closePopup();
if (!(popup instanceof L.Popup)) {
popup = new L.Popup(options)
.setLatLng(latlng)
.setContent(popup);
}
popup._isOpen = true;
this._popup = popup;
return this.addLayer(popup);
},
});
L.Marker = L.Marker.extend({
options: {
riseOnHover: true,
distance: 200,
interval: 1000,
autoStart: true,
onEnd: function () {
}
},
closePopup: function (t) {
t = t || 300;
var ths = this;
if (this._popup) {
ths._timer = new Timer(function () {
ths._popup._close();
}, t);
}
return this;
},
bindPopup: function (content, options) {
if (options && options.showOnMouseOver) {
if (options.typeStyle) {
this._popup = content;
this._popup = new L.Popup(options, this);
this._popup.setContent(content);
popupstyle = options.typeStyle;
this.on("add remove", function () {
L.DomEvent.on(this, "mouseenter", function (event) {
this._removePopups();
this._openPopup();
this._timer.pause();
L.DomEvent.on(this._popup._container, "mouseenter", this._enterPopup, this);
L.DomEvent.on(this._popup._container, "mouseleave", this._leavePopup, this);
L.DomEvent.on(this._map._container, "mouseenter", this._removePopups, this);
...