';
shop_details += '
' + 'Raelene P' +'('+ 'Pharmacy Assistant' + ')' + '';
shop_details += '
[email protected]';
shop_details += '
[email protected] Shop G039 Quadrangle Building
';
shop_details += 'UNSW SYDNEY NSW 2052
';
shop_details += '0296630883
';
shop_details += '(distance: 13361.3km from Center (Blue))';
shop_details += '
';
places.push(new google.maps.LatLng(-33.917111, 151.2305536));
popup.push(shop_details);
// Adding the center markers
//places.push(new google.maps.LatLng(39.0481,-77.4728));
//popup.push("Suburb Center");
// Creating a variable that will hold
// the InfoWindow object
var infowindow;
// Looping through the places array
for (var i = 0; i < places.length; i++)
{
// first object is the home object
if (i == 0) {
var marker = new google.maps.Marker({
position: places[i],
map: map,
});
} else {
// Adding the markers
var marker = new google.maps.Marker({
position: places[i],
map: map
});
}
// Wrapping the event listener inside an anonymous function
// that we immediately invoke and passes the variable i to.
(function(i, marker) {
// Creating the event listener. It now has access to the values of
// i and marker as they were during its creation
google.maps.event.addListener(marker, 'click', function() {
// Check to see if we already have an InfoWindow
if (!infowindow) {
infowindow = new google.maps.InfoWindow();
}
// Setting the content of the InfoWindow
infowindow.setContent(popup[i]);
// Tying the InfoWindow to the marker
infowindow.open(map, marker);
map.setZoom(16);
map.setCenter(places[i]);
});
// we dont add suburb center cause we're not showing it
if (i > 0)
{
//google.maps.event.addDomListener(document.getElementById('shop-'+i), "click", function(ev) {
google.maps.event.addDomListener($(datatable).find('#shop-'+i)[0], 'click', function(ev) {
// Check to see if we already have an InfoWindow
if (!infowindow) {
infowindow = new google.maps.InfoWindow();
}
// Setting the content of the InfoWindow
infowindow.setContent(popup[i]);
map.panTo(places[i]);
map.setZoom(16);
infowindow.open(map, marker);
});
}
})(i, marker);
// Extending the bounds object with each LatLng
bounds.extend(places[i]);
}
// Adjusting the map to new bounding box
map.fitBounds(bounds)
};
}); //end document ready