<script type="text/javascript">
// Enable the visual refresh
google.maps.visualRefresh = true;
// Set the Map variable
var map;
var infowindow = new google.maps.InfoWindow();
function initialize() {
var myOptions = {
zoom: 8,
mapTypeControl: true,
scrollwheel: true,
streetViewControl : true,
mapTypeId: google.maps.MapTypeId.ROADMAP,
styles:[
{ featureType: "water", stylers: [ { color: "#8DC4E1", hue: 0.1 } ] },
{ featureType: "landscape.natural", stylers: [ { color: "#F4F3EF", lightness: +100 } ] },
{ featureType: "road.local", stylers: [ { color: "#FFF" } ] }
],
};
var all = [
["4605 S Tamiami Trail, Sarasota, FL 34231, USA", "27.287359", "-82.530634"],
["8519 state road 70 east bradenton fl 34211", "27.439685", "-82.452375"],
];
var infoWindow = new google.maps.InfoWindow;
map = new google.maps.Map(document.getElementById('map_canvas'), myOptions);
map1 = new google.maps.Map(document.getElementById('map_canvas1'), myOptions);
// Set the center of the map
var pos = new google.maps.LatLng(27.287359, -82.530634);
var pos1 = new google.maps.LatLng(27.439685, -82.452375);
map.setCenter(pos);
map1.setCenter(pos1);
function closeinfocallback(infowindow)
{
return infowindow.close();
}
function infoCallback(infowindow, marker,map)
{
return function() {
infowindow.open(map, marker);
};
}
function setMarkers(map, all,i)
{
var name = all[i][0];
var lat = all[i][1];
var lng = all[i][2];
var latlngset;
latlngset = new google.maps.LatLng(lat, lng);
var marker = new google.maps.Marker({
position: latlngset,
map: map,
});
var content = '<div class="map-content"><h3>' + name + '</h3></div>';
var infowindow = new google.maps.InfoWindow();
infowindow.setContent(content);
google.maps.event.addListener(marker, 'click', infoCallback(infowindow, marker,map));
}
// Set all markers in the all variable
setMarkers(map, all,'0');
setMarkers(map1, all,'1');
}
// Initializes the Google Map
google.maps.event.addDomListener(window, 'load', initialize);
</script>