Ciao a tutti,
carico da db i marker dell'azienda per cui sto lavorando su google maps.
Mi restituisce questo errore, che pare dipendere dal numero eccessivo dei marker utilizzati (siamo a 147)
Script: http***://maps.gstatic.com/intl/es_ALL/mapfiles/193c/maps2.api/main.js:68
Chiaramente non riesco a capire quale sia l'errore nello script che vi ho postato e sto cercando eventuali alternative leggendo queste risorse on-line delle mappe di google.
http://googlemapsapi.blogspot.com/20...r-manager.html (link principale)
ed in particolare questo
http://code.google.com/intl/it-IT/ap...GMarkerManager
Pero' sto in alto mare, sia nella risoluzione del codice attuale che di una eventuale sostituzione.
Qualcuno ha avuto lo stesso problema o sa come risolverlo?
Grazie in anticipo
ps. Vi posto il codice attuale
Codice PHP:
<script src="http://maps.google.com/maps?file=api&v=2&key=CHIAVE"
type="text/javascript"></script>
<script type="text/javascript">
function buscar(){
var address=document.getElementById("address");
var city=document.getElementById("city");
var state=document.getElementById("state");
showAddress(state.options[state.selectedIndex].text + ", " + city.options[city.selectedIndex].text + ", " + address.value);
}
function showAddress(address) {
var map = initialize();
var geocoder = new GClientGeocoder();
geocoder.getLatLng(
address,
function(point) {
if (!point) {
alert(address + " not found");
} else {
map.setCenter(point, 13);
var marker = new GMarker(point);
map.addOverlay(marker);
marker.openInfoWindowHtml(address);
GEvent.addListener(marker, "click", function() {
marker<?=$contador?>.openInfoWindowHtml(address);
});
}
}
);
}
// Call this function when the page has been loaded
function initialize() {
var map = new GMap2(document.getElementById("cw_google_maps"));
map.addControl(new GMapTypeControl());
map.setUIToDefault();
<?php
$contador=0;
foreach ($aShopList as $keyWarehouse=>$valueWarehouse){
$contador++;
?>
var icono<?=$contador?> = new GIcon();
icono<?=$contador?>.image = "images_localizador.php?logo=<?=$valueWarehouse['logoID']?>";
icono<?=$contador?>.iconSize = new GSize(<?=$valueWarehouse[logo_width]?>, <?=$valueWarehouse[logo_height]?>);
icono<?=$contador?>.iconAnchor = new GPoint(37, 59);
icono<?=$contador?>.infoWindowAnchor = new GPoint(31, 8);
var coords = new GLatLng(<?=$valueWarehouse[yMap]?>,<?=$valueWarehouse[xMap]?>);
var marker<?=$contador?> = new GMarker(coords, icono<?=$contador?>);
map.addOverlay(marker<?=$contador?>);
GEvent.addListener(marker<?=$contador?>, "click", function() {
marker<?=$contador?>.openInfoWindowHtml('<div style="white-space:nowrap">[b]<?=$valueWarehouse['alias']?>[/b]
<?=$valueWarehouse['phone1']?>
<?=$valueWarehouse['address']?>
<?=$valueWarehouse['city_name']?>
<?=$valueWarehouse['zipCode']?></div>');
});
<?php
}
?>
return map;
}
</script>