Ho un errore davvero strano che continua a causare il blocco del mio browser solo quando provo a ridimensionare una mappa per adattarla ai marcatori che ho inserito.map.fitBounds (limiti) che causano il blocco del browser
Il mio codice di ridimensionamento per riferimento:
function sizeMap() {
// create a new bounds object to define the new boundry
var bounds = new google.maps.LatLngBounds();
// loop through each the string latlang values held in the latlng
// aray
for (var i = 0; i <latlngArray.length ; i++) {
// create a new LatLng object based on the string value
var tempLatLng = new google.maps.LatLng(latlngArray[i]);
// extend the latlng bounds based on the new location
bounds.extend(tempLatLng);
}
// map.fitBounds(bounds); <== everything seems to work fine until this line is uncommented
}
Il problema è che non posso eseguire il debug correttamente utilizzando Firebug perché che congela a! Qualcuno ha qualche idea su quale potrebbe essere il problema?
Grazie in anticipo.
Aggiornamento:
In risposta alla puckheads in discussione il seguente codice mostra dove la matrice LatLng è popolato di iniziare con:
function geocodeAddress (address) {
var geocoder = new google.maps.Geocoder();
geocoder.geocode({'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
loadMarker(results[0].geometry.location,"Info here",address);
latlngArray.push(results[0].geometry.location); <== latlngs are first added here they are as a result of a call to the google geocode service with a standard string address.
} else {
alert("Geocode was not successful for the following reason: " +" "+ status);
}
});
}
Hai risolto la domanda? - In tal caso dovresti accettare o scrivere la tua risposta corretta! – levi
Hai provato con Chrome e la console javascript? – MrUpsidown