hidrau
asked on
Help with script and google maps
Hello guys,
I have this code bellow that is created by my system:
What is it wrong with the code? It worked few days ago and now it is not. :(
Thanks
Alex
I have this code bellow that is created by my system:
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=11">
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"> </script>
<script type="text/javascript">
function matriz(indice, geocoder, nomeCidade, cor, latlng, info, qtdLoja, checkbox) {
this.indice = indice;
this.geocoder = geocoder;
this.nomeCidade = nomeCidade;
this.cor = cor;
this.latlng = latlng;
this.info = info;
this.qtdLoja = qtdLoja;
this.checkbox = checkbox;
}
//cria variáveis globais a serem usadas
var map;
var aCliente = new Array;
var aGeocoder = new Array;
aGeocoder[0] = new google.maps.Geocoder();
function geocoderCallBack0(point) {if (!point) {} else {map.addOverlay(createMarker(point,0)); }};
aCliente[0] = new matriz(0, aGeocoder[0], "SAO PAULO", "yellow", "-14.2350040,-51.9252800", "4 - BARCLAYS<br/>FATURAMENTO,40<br/>SAO PAULO - SP<br/>Fone: (55) 5555555",
"{qtdLoja}", "{checkbox}");
aGeocoder[1] = new google.maps.Geocoder();
function geocoderCallBack0(point) {if (!point) {} else {map.addOverlay(createMarker(point,1)); }};
aCliente[1] = new matriz(1, aGeocoder[1], "SAO PAULO", "yellow", "-23.5871900,-46.6752099", "5 - BANCO BNP PARIBAS BRASIL S.A.<br/>AV PRESIDENTE JUSCELINO
KUBITSCHEK,510<br/>SAO PAULO - SP<br/>Fone: () ", "{qtdLoja}", "{checkbox}");
var iTotal = 85;
var LatCenter = -23.5505199;
var LngCenter = -46.6333094;
var Vzoom = 12;
function createMarker(point, index) {
var image = "http://www.google.com/intl/en_us/mapfiles/ms/micons/" + aCliente[index].cor + "-dot.png";
var cliente = aCliente[index].nomeCidade;
var info1 = aCliente[index].info1;
var info = aCliente[index].info;
var qtdLoja = aCliente[index].qtdLoja;
markerOptions = { position: point, map: map, icon: image, title: cliente };
var marker = new google.maps.Marker(markerOptions);
var info2 ='<b>' + info + '</b><br />' + '<b>';
var infowindow = new google.maps.InfoWindow({content: info2});
google.maps.event.addListener(marker, "click", function () {
infowindow.open(map, marker);
});
return marker;
}
window.onload = function () {
var myOptions = {
zoom: Vzoom,
size: new google.maps.Size(965, 415),
mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControl: true,
mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR, position: google.maps.ControlPosition.BOTTOM },
navigationControl: true,
navigationControlOptions: { style: google.maps.NavigationControlStyle.ZOOM_PAN, position: google.maps.ControlPosition.TOP_RIGHT },
scaleControl: true,
scaleControlOptions: { position: Google.maps.ControlPosition.TOP_LEFT }
};
map = new google.maps.Map(document.getElementById("mapa"), myOptions);
map.setCenter(new google.maps.LatLng(LatCenter, LngCenter), 4);
var i = 0;
var markers = [];
for (i = 0; i <= iTotal - 1; i++) {
if (aCliente[i].latlng == "0, 0") {
aCliente[i].geocoder.getLatLng(aCliente[i].endereco, eval('geocoderCallBack' + i));
}
else {
var latlng = eval("new google.maps.LatLng(" + aCliente[i].latlng + ")");
marker = createMarker(latlng, i);
markers.push(marker);
}
}
if(aCliente[0].checkbox == 1){
var markerCluster = new MarkerClusterer(map, markers);
}
}
</script>
</head>
<body>
<div id="mapa" style="height: 96%; width: 100%; margin-top: 3px;"></div>
<div id="legenda" style="float:left;margin-top: 3px;">
<img src="http://www.google.com/intl/en_us/mapfiles/ms/micons/yellow-dot.png" height="16" />Clientes e Fornecedores
<img src="http://www.google.com/intl/en_us/mapfiles/ms/micons/green-dot.png" height="16" />Clientes
<img src="http://www.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png" height="16" />Fornecedores
<img src="http://www.google.com/intl/en_us/mapfiles/ms/micons/blue-dot.png" height="16" />Outros
</div>
</body>
</html>
What is it wrong with the code? It worked few days ago and now it is not. :(
Thanks
Alex
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER