Google Maps JS v3 - árbol DOM separado - pérdida de memoria?
Tengo el siguiente problema. Estoy eliminando todas las referencias a una instancia de Google Maps, incluidos los marcadores a través desetMap(null)
Opción a través del siguiente código:
destroyMaps = function () {
leftMap = null;
window.map = null;
geocoder = null;
for (var i=0; i<window.rightMarkers.length; i++) {
window.rightMarkers[i].setMap(null);
window.rightMarkers[i] = null;
}
window.rightMarkers = null;
$("#map-canvas-right").remove();
for (var i=0; i<window.leftMarkers.length; i++) {
window.leftMarkers[i].setMap(null);
window.leftMarkers[i] = null;
}
window.leftMarkers = null;
$("#map-canvas-left").remove();
}
Las únicas cosas que hacen referencia.leftMap
owindow.map
en mi código entero es:
window.map
var marker = new google.maps.Marker({
position: myLatlng,
map: window.map,
icon: window.pins[keyword_category.category_name],
shadow: window.pins["Shadow"],
title:job.job_title
});
marker.job_type = keyword_category.category_name;
window.rightMarkers.push(marker);
porleftMap
var marker = new google.maps.Marker({
position: myLatlng,
map: leftMap,
icon: window.pins[keyword_category.category_name],
shadow: window.pins["Shadow"],
title:job.job_title
});
window.leftMarkers.push(marker);
Sin embargo, en mi árbol DOM separado, al comparar antes de que se crearan los mapas / después de que fueron destruidos, quedan los mosaicos de Google Maps:
(Clic derecho - abrir imagen para ver a tamaño completo)
¿Qué puedo hacer para averiguar qué está causando esta fuga de DOM?