Skip to content

Instantly share code, notes, and snippets.

@rjfranco
Created May 3, 2011 22:10
Show Gist options
  • Save rjfranco/954371 to your computer and use it in GitHub Desktop.
Save rjfranco/954371 to your computer and use it in GitHub Desktop.
A map js file with issues.
for (var i = 0; i < businesses.length; i++) {
codeAddress(businesses[i].address,i,function(i,point){
var description = businesses[i].description;
if(businesses[i].business_type == "Wine"){
//http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=A|00CC99|000000
var icon = 'http://google-maps-icons.googlecode.com/files/wineyard.png';
}else if(businesses[i].business_type == "Golf"){
var icon = 'http://google-maps-icons.googlecode.com/files/golf.png';
}else{
var icon = 'http://google-maps-icons.googlecode.com/files/festival.png';
}
var marker = new google.maps.Marker({
position: point,
map: map,
//icon: icon,
zIndex: Math.round(point.lat()*-100000)<<5
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.setContent(description);
infowindow.open(map,marker);
});
markers.push(marker);
side_bar_html += '<a href="javascript:myclick(' + (markers.length-1) + ')">' + businesses[i].name + '<\/a><br />'+description+'<br />';
//var marker = createMarker(point,businesses[i].name,description,icon);
var markerCluster = new MarkerClusterer(map, markers);
// put the assembled side_bar_html contents into the side_bar div
document.getElementById("side_bar").innerHTML = side_bar_html;
});//End codeAddress-function
}//End for-loop
console.log(markers);
var markerCluster = new MarkerClusterer(map, markers);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment