Merge pull request #3732 from rashidkpc/fix/tile-map-dom-leak

Cleanup Leaflet DOM nodes
This commit is contained in:
Lukas Olson 2015-05-01 16:52:09 -07:00
commit fa836292fc

View file

@ -502,6 +502,7 @@ define(function (require) {
TileMap.prototype.bindPopup = function (feature, layer) {
var props = feature.properties;
var popup = L.popup({
className: 'leaflet-popup-kibana',
autoPan: false
})
.setContent(
@ -616,6 +617,9 @@ define(function (require) {
* @return {undefined}
*/
TileMap.prototype.destroy = function () {
// Cleanup hanging DOM nodes
$(this.chartEl).find('[class*=" leaflet"]').remove();
this.maps.forEach(function (map) {
map.remove();
});