Interactive Map

Stay Stay

Restaurants Restaurants

Agritourism Agritourism

History and Heritage History and Heritage

Shopping Shopping

Arts Arts

Attractions Attractions

'; } if(item.hasOwnProperty("link_url") && item.link_url !== "") { infoWindowContent += ''; } infoWindowContent += ''; if(item.hasOwnProperty('icon') && item.icon !== "") { var icon = { url: item.icon, size: new google.maps.Size(setupOptions.markerWidth, setupOptions.markerHeight), origin: new google.maps.Point(0,0), anchor: new google.maps.Point(0, setupOptions.markerHeight) }; } else { var image = false; } if(item.hasOwnProperty('markerCategory') && item.markerCategory !== "") { var category = item.markerCategory; } else { var category = ""; } if(item.dspOnMap) { var pkg = [ item.name, item.lat, item.lng, index+1, 'marker_'+index+1, infoWindowContent, icon, category ]; if(item.hasOwnProperty('markerResource_directory') ){ pkg.push(item.markerResource_directory); } offices.push(pkg); } }); } //call the function that adds the markers to the map. if(offices.length > 0) { addMarker(offices, gmap, shape); } function addMarker(obj, map, shape) { //create an array to hold all of the infowindow objects var infoWindowArray = []; //loop through each office in the array and create a marker and the neccessary event listners for each marker. $.each(obj, function(idx, value) { var title = value[0]; var lat = value[1]; var lng = value[2]; var index = value[3]; var name = value[4]; var content = value[5]; var markerIcon = value[6]; var markerCategory = value[7]; var markerResource_directory = null; if (typeof value[8] !== 'undefined') { var markerResource_directory = value[8]; } if(typeof markerIcon == "object") { name = new google.maps.Marker({ position : new google.maps.LatLng(lat, lng), title: title, map:map, icon: markerIcon, shape: shape }); } else { name = new google.maps.Marker({ position : new google.maps.LatLng(lat, lng), title: title, map:map, shape: shape }); } name.category = markerCategory; name.resource_directory = markerResource_directory; //add each marker to the array of markers markers.push(name); //setup the click event for each marker google.maps.event.addListener(name, "click", function() { if (infowindow) infowindow.close(); infowindow = new google.maps.InfoWindow({content: content}); infowindow.open(gmap, name); }); //open all the infowindows for all the markers when the page loads, and add the infowindows to the array infowindow = new google.maps.InfoWindow({content: content}); // we may not want the infowindows to open when the page loads due to overlapping issues with mutiple markers if(setupOptions.openInfoWindowOnLoad) { infowindow.open(gmap, name); } //add each infowindow to the array of infowindows infoWindowArray.push(infowindow); });//end loop //setup the map click event listener so that we can close all the open infowindows by clicking the map google.maps.event.addListener(gmap, "click", function() { for(var i=0; i= 2) { var middle_marker = Math.round(markers.length/2); } else { var middle_marker = 0; } //this adjusts the map center so that the infowindows are not extending outside the container var center_lat = obj[middle_marker][1]+parseFloat(setupOptions.centerMapXOffset); // default 0.14500000 var center_lng = obj[middle_marker][2]+parseFloat(setupOptions.centerMapYOffset); //default 0 } var map_center = new google.maps.LatLng(center_lat, center_lng); gmap.setCenter(map_center); } if(offices.length > 0) { centerMap(offices); } }//end setupMap