// if ( BrowserIsGMapsCompatible() ) { var gmaps_marker = []; var gmaps_marker_shadow = []; var gmaps_marker_main = []; var gmaps_marker_infowindow = []; var gmaps_marker_is_hovering = []; function gmaps_marker_mouseover(count,image_hover,html,tooltip_xoffset,tooltip_yoffset) { // switch icon image for hover image on marker mouseover and display the tooltip if ( ! gmaps_marker_is_hovering[count] ) { gmaps_marker_is_hovering[count] = 1; gmaps_marker_main[count].setIcon( image_hover ); if (html) { // show tooltip var tooltipContentString = '
'+html+'
'; gmaps_marker_infowindow[count] = new google.maps.InfoWindow({ content: tooltipContentString, // maxWidth: 400, pixelOffset: new google.maps.Size(tooltip_xoffset,tooltip_yoffset) }); gmaps_marker_infowindow[count].open(map, gmaps_marker_main[count]); } } return true; } function gmaps_marker_mouseout(count,image_main) { // switch hover image for main image on marker mouseout and hide the tooltip if ( gmaps_marker_is_hovering[count] ) { gmaps_marker_is_hovering[count] = 0; gmaps_marker_main[count].setIcon( image_main ); if ( gmaps_marker_infowindow[count] ) { // hide tooltip gmaps_marker_infowindow[count].close(); } } return true; } // function to create the marker and set up the event window function createMarker(map,lat_lng,html,count,thing_id) { var detail_url = ''; // extract required info associated with the particular thing_id if ( thing_id == 2964 ) { var image_shadow = { url: 'https://www.top10fresh.com/produce/reviews/skins/default/images/misc/gmaps_shadow_3.png', // This shadow marker is normally 71 pixels wide by 40 pixels high. size: new google.maps.Size(71, 40), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base normally at (43, 40). anchor: new google.maps.Point(43, 40) }; gmaps_marker_shadow[count] = new google.maps.Marker({ position: lat_lng, map: map, icon: image_shadow, zIndex: 1 }); var image_main = { url: 'https://www.top10fresh.com/produce/reviews/google/icons/main/8/7/1/871.png', // This marker is normally 50 pixels wide by 40 pixels high. size: new google.maps.Size(50, 50), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base at (43, 40). anchor: new google.maps.Point(43, 40) }; // Shapes define the clickable region of the icon. The type defines an HTML // rect: coords is [x1,y1,x2,y2] where x1,y1 are the coordinates of the upper-left corner // of the rectangle and x2,y2 are the coordinates of the lower-right coordinates of the rectangle. var shape = { coords: [ 25, 0, 50, 50 ], type: 'rect' }; gmaps_marker_main[count] = new google.maps.Marker({ position: lat_lng, map: map, icon: image_main, shape: shape, title: 'Gazelle Organics', zIndex: 100 }); var image_hover = { url: 'https://www.top10fresh.com/produce/reviews/google/icons/hover/8/7/1/871.png', // This marker is normally 50 pixels wide by 40 pixels high. size: new google.maps.Size(50, 50), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base normally at (43, 40). anchor: new google.maps.Point(43, 40) }; gmaps_marker_is_hovering[count] = 0; detail_url = 'https://www.top10fresh.com/reviews/farmers/California/sbr/date_desc/2964/gazelle-organics.htm'; if (detail_url) { // clicking on the marker will open the detail page for the thing; hovering will show the tooltip var clickURL = detail_url; var target = '_self'; gmaps_marker_main[count].addListener('click', function() { window.open(clickURL, target); }); } // switch icon image for hover image on marker mouseover and mouseout gmaps_marker_main[count].addListener( 'mouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0) }); gmaps_marker_main[count].addListener( 'mouseout', function() { gmaps_marker_mouseout(count,image_main) }); // add listeners to allow the tooltips to be invoked when // mousing over the known_as links in the thing listing var link_id = 'known_as_link_2964'; var link_elem = document.getElementById(link_id); if (window.addEventListener) // Mozilla, Netscape, Firefox { link_elem.addEventListener( 'mouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0); }, false ); link_elem.addEventListener( 'mouseout', function() { gmaps_marker_mouseout(count,image_main); }, false ); } else // IE { link_elem.attachEvent( 'onmouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0); } ); link_elem.attachEvent( 'onmouseout', function() { gmaps_marker_mouseout(count,image_main); } ); } } if ( thing_id == 2965 ) { var image_shadow = { url: 'https://www.top10fresh.com/produce/reviews/skins/default/images/misc/gmaps_shadow_3.png', // This shadow marker is normally 71 pixels wide by 40 pixels high. size: new google.maps.Size(71, 40), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base normally at (43, 40). anchor: new google.maps.Point(43, 40) }; gmaps_marker_shadow[count] = new google.maps.Marker({ position: lat_lng, map: map, icon: image_shadow, zIndex: 1 }); var image_main = { url: 'https://www.top10fresh.com/produce/reviews/google/icons/main/8/7/2/872.png', // This marker is normally 50 pixels wide by 40 pixels high. size: new google.maps.Size(50, 50), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base at (43, 40). anchor: new google.maps.Point(43, 40) }; // Shapes define the clickable region of the icon. The type defines an HTML // rect: coords is [x1,y1,x2,y2] where x1,y1 are the coordinates of the upper-left corner // of the rectangle and x2,y2 are the coordinates of the lower-right coordinates of the rectangle. var shape = { coords: [ 25, 0, 50, 50 ], type: 'rect' }; gmaps_marker_main[count] = new google.maps.Marker({ position: lat_lng, map: map, icon: image_main, shape: shape, title: 'Gildea Resource Center Urban Farm', zIndex: 100 }); var image_hover = { url: 'https://www.top10fresh.com/produce/reviews/google/icons/hover/8/7/2/872.png', // This marker is normally 50 pixels wide by 40 pixels high. size: new google.maps.Size(50, 50), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base normally at (43, 40). anchor: new google.maps.Point(43, 40) }; gmaps_marker_is_hovering[count] = 0; detail_url = 'https://www.top10fresh.com/reviews/farmers/California/sbr/date_desc/2965/gildea-resource-center-urban-farm.htm'; if (detail_url) { // clicking on the marker will open the detail page for the thing; hovering will show the tooltip var clickURL = detail_url; var target = '_self'; gmaps_marker_main[count].addListener('click', function() { window.open(clickURL, target); }); } // switch icon image for hover image on marker mouseover and mouseout gmaps_marker_main[count].addListener( 'mouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0) }); gmaps_marker_main[count].addListener( 'mouseout', function() { gmaps_marker_mouseout(count,image_main) }); // add listeners to allow the tooltips to be invoked when // mousing over the known_as links in the thing listing var link_id = 'known_as_link_2965'; var link_elem = document.getElementById(link_id); if (window.addEventListener) // Mozilla, Netscape, Firefox { link_elem.addEventListener( 'mouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0); }, false ); link_elem.addEventListener( 'mouseout', function() { gmaps_marker_mouseout(count,image_main); }, false ); } else // IE { link_elem.attachEvent( 'onmouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0); } ); link_elem.attachEvent( 'onmouseout', function() { gmaps_marker_mouseout(count,image_main); } ); } } if ( thing_id == 2966 ) { var image_shadow = { url: 'https://www.top10fresh.com/produce/reviews/skins/default/images/misc/gmaps_shadow_3.png', // This shadow marker is normally 71 pixels wide by 40 pixels high. size: new google.maps.Size(71, 40), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base normally at (43, 40). anchor: new google.maps.Point(43, 40) }; gmaps_marker_shadow[count] = new google.maps.Marker({ position: lat_lng, map: map, icon: image_shadow, zIndex: 1 }); var image_main = { url: 'https://www.top10fresh.com/produce/reviews/google/icons/main/8/7/3/873.png', // This marker is normally 50 pixels wide by 40 pixels high. size: new google.maps.Size(50, 50), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base at (43, 40). anchor: new google.maps.Point(43, 40) }; // Shapes define the clickable region of the icon. The type defines an HTML // rect: coords is [x1,y1,x2,y2] where x1,y1 are the coordinates of the upper-left corner // of the rectangle and x2,y2 are the coordinates of the lower-right coordinates of the rectangle. var shape = { coords: [ 25, 0, 50, 50 ], type: 'rect' }; gmaps_marker_main[count] = new google.maps.Marker({ position: lat_lng, map: map, icon: image_main, shape: shape, title: 'Grass Valley Grains', zIndex: 100 }); var image_hover = { url: 'https://www.top10fresh.com/produce/reviews/google/icons/hover/8/7/3/873.png', // This marker is normally 50 pixels wide by 40 pixels high. size: new google.maps.Size(50, 50), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base normally at (43, 40). anchor: new google.maps.Point(43, 40) }; gmaps_marker_is_hovering[count] = 0; detail_url = 'https://www.top10fresh.com/reviews/farmers/California/sbr/date_desc/2966/grass-valley-grains.htm'; if (detail_url) { // clicking on the marker will open the detail page for the thing; hovering will show the tooltip var clickURL = detail_url; var target = '_self'; gmaps_marker_main[count].addListener('click', function() { window.open(clickURL, target); }); } // switch icon image for hover image on marker mouseover and mouseout gmaps_marker_main[count].addListener( 'mouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0) }); gmaps_marker_main[count].addListener( 'mouseout', function() { gmaps_marker_mouseout(count,image_main) }); // add listeners to allow the tooltips to be invoked when // mousing over the known_as links in the thing listing var link_id = 'known_as_link_2966'; var link_elem = document.getElementById(link_id); if (window.addEventListener) // Mozilla, Netscape, Firefox { link_elem.addEventListener( 'mouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0); }, false ); link_elem.addEventListener( 'mouseout', function() { gmaps_marker_mouseout(count,image_main); }, false ); } else // IE { link_elem.attachEvent( 'onmouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0); } ); link_elem.attachEvent( 'onmouseout', function() { gmaps_marker_mouseout(count,image_main); } ); } } if ( thing_id == 2968 ) { var image_shadow = { url: 'https://www.top10fresh.com/produce/reviews/skins/default/images/misc/gmaps_shadow_3.png', // This shadow marker is normally 71 pixels wide by 40 pixels high. size: new google.maps.Size(71, 40), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base normally at (43, 40). anchor: new google.maps.Point(43, 40) }; gmaps_marker_shadow[count] = new google.maps.Marker({ position: lat_lng, map: map, icon: image_shadow, zIndex: 1 }); var image_main = { url: 'https://www.top10fresh.com/produce/reviews/google/icons/main/8/7/5/875.png', // This marker is normally 50 pixels wide by 40 pixels high. size: new google.maps.Size(50, 50), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base at (43, 40). anchor: new google.maps.Point(43, 40) }; // Shapes define the clickable region of the icon. The type defines an HTML // rect: coords is [x1,y1,x2,y2] where x1,y1 are the coordinates of the upper-left corner // of the rectangle and x2,y2 are the coordinates of the lower-right coordinates of the rectangle. var shape = { coords: [ 25, 0, 50, 50 ], type: 'rect' }; gmaps_marker_main[count] = new google.maps.Marker({ position: lat_lng, map: map, icon: image_main, shape: shape, title: 'Grass-Fed Meats', zIndex: 100 }); var image_hover = { url: 'https://www.top10fresh.com/produce/reviews/google/icons/hover/8/7/5/875.png', // This marker is normally 50 pixels wide by 40 pixels high. size: new google.maps.Size(50, 50), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base normally at (43, 40). anchor: new google.maps.Point(43, 40) }; gmaps_marker_is_hovering[count] = 0; detail_url = 'https://www.top10fresh.com/reviews/farmers/California/sbr/date_desc/2968/grass-fed-meats.htm'; if (detail_url) { // clicking on the marker will open the detail page for the thing; hovering will show the tooltip var clickURL = detail_url; var target = '_self'; gmaps_marker_main[count].addListener('click', function() { window.open(clickURL, target); }); } // switch icon image for hover image on marker mouseover and mouseout gmaps_marker_main[count].addListener( 'mouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0) }); gmaps_marker_main[count].addListener( 'mouseout', function() { gmaps_marker_mouseout(count,image_main) }); // add listeners to allow the tooltips to be invoked when // mousing over the known_as links in the thing listing var link_id = 'known_as_link_2968'; var link_elem = document.getElementById(link_id); if (window.addEventListener) // Mozilla, Netscape, Firefox { link_elem.addEventListener( 'mouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0); }, false ); link_elem.addEventListener( 'mouseout', function() { gmaps_marker_mouseout(count,image_main); }, false ); } else // IE { link_elem.attachEvent( 'onmouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0); } ); link_elem.attachEvent( 'onmouseout', function() { gmaps_marker_mouseout(count,image_main); } ); } } if ( thing_id == 2970 ) { var image_shadow = { url: 'https://www.top10fresh.com/produce/reviews/skins/default/images/misc/gmaps_shadow_3.png', // This shadow marker is normally 71 pixels wide by 40 pixels high. size: new google.maps.Size(71, 40), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base normally at (43, 40). anchor: new google.maps.Point(43, 40) }; gmaps_marker_shadow[count] = new google.maps.Marker({ position: lat_lng, map: map, icon: image_shadow, zIndex: 1 }); var image_main = { url: 'https://www.top10fresh.com/produce/reviews/google/icons/main/8/7/6/876.png', // This marker is normally 50 pixels wide by 40 pixels high. size: new google.maps.Size(50, 50), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base at (43, 40). anchor: new google.maps.Point(43, 40) }; // Shapes define the clickable region of the icon. The type defines an HTML // rect: coords is [x1,y1,x2,y2] where x1,y1 are the coordinates of the upper-left corner // of the rectangle and x2,y2 are the coordinates of the lower-right coordinates of the rectangle. var shape = { coords: [ 25, 0, 50, 50 ], type: 'rect' }; gmaps_marker_main[count] = new google.maps.Marker({ position: lat_lng, map: map, icon: image_main, shape: shape, title: 'Greenhearts Family Farm CSA', zIndex: 100 }); var image_hover = { url: 'https://www.top10fresh.com/produce/reviews/google/icons/hover/8/7/6/876.png', // This marker is normally 50 pixels wide by 40 pixels high. size: new google.maps.Size(50, 50), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base normally at (43, 40). anchor: new google.maps.Point(43, 40) }; gmaps_marker_is_hovering[count] = 0; detail_url = 'https://www.top10fresh.com/reviews/farmers/California/sbr/date_desc/2970/greenhearts-family-farm-csa.htm'; if (detail_url) { // clicking on the marker will open the detail page for the thing; hovering will show the tooltip var clickURL = detail_url; var target = '_self'; gmaps_marker_main[count].addListener('click', function() { window.open(clickURL, target); }); } // switch icon image for hover image on marker mouseover and mouseout gmaps_marker_main[count].addListener( 'mouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0) }); gmaps_marker_main[count].addListener( 'mouseout', function() { gmaps_marker_mouseout(count,image_main) }); // add listeners to allow the tooltips to be invoked when // mousing over the known_as links in the thing listing var link_id = 'known_as_link_2970'; var link_elem = document.getElementById(link_id); if (window.addEventListener) // Mozilla, Netscape, Firefox { link_elem.addEventListener( 'mouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0); }, false ); link_elem.addEventListener( 'mouseout', function() { gmaps_marker_mouseout(count,image_main); }, false ); } else // IE { link_elem.attachEvent( 'onmouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0); } ); link_elem.attachEvent( 'onmouseout', function() { gmaps_marker_mouseout(count,image_main); } ); } } if ( thing_id == 2971 ) { var image_shadow = { url: 'https://www.top10fresh.com/produce/reviews/skins/default/images/misc/gmaps_shadow_3.png', // This shadow marker is normally 71 pixels wide by 40 pixels high. size: new google.maps.Size(71, 40), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base normally at (43, 40). anchor: new google.maps.Point(43, 40) }; gmaps_marker_shadow[count] = new google.maps.Marker({ position: lat_lng, map: map, icon: image_shadow, zIndex: 1 }); var image_main = { url: 'https://www.top10fresh.com/produce/reviews/google/icons/main/8/7/7/877.png', // This marker is normally 50 pixels wide by 40 pixels high. size: new google.maps.Size(50, 50), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base at (43, 40). anchor: new google.maps.Point(43, 40) }; // Shapes define the clickable region of the icon. The type defines an HTML // rect: coords is [x1,y1,x2,y2] where x1,y1 are the coordinates of the upper-left corner // of the rectangle and x2,y2 are the coordinates of the lower-right coordinates of the rectangle. var shape = { coords: [ 25, 0, 50, 50 ], type: 'rect' }; gmaps_marker_main[count] = new google.maps.Marker({ position: lat_lng, map: map, icon: image_main, shape: shape, title: 'Growing Beet Organic Garden', zIndex: 100 }); var image_hover = { url: 'https://www.top10fresh.com/produce/reviews/google/icons/hover/8/7/7/877.png', // This marker is normally 50 pixels wide by 40 pixels high. size: new google.maps.Size(50, 50), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base normally at (43, 40). anchor: new google.maps.Point(43, 40) }; gmaps_marker_is_hovering[count] = 0; detail_url = 'https://www.top10fresh.com/reviews/farmers/California/sbr/date_desc/2971/growing-beet-organic-garden.htm'; if (detail_url) { // clicking on the marker will open the detail page for the thing; hovering will show the tooltip var clickURL = detail_url; var target = '_self'; gmaps_marker_main[count].addListener('click', function() { window.open(clickURL, target); }); } // switch icon image for hover image on marker mouseover and mouseout gmaps_marker_main[count].addListener( 'mouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0) }); gmaps_marker_main[count].addListener( 'mouseout', function() { gmaps_marker_mouseout(count,image_main) }); // add listeners to allow the tooltips to be invoked when // mousing over the known_as links in the thing listing var link_id = 'known_as_link_2971'; var link_elem = document.getElementById(link_id); if (window.addEventListener) // Mozilla, Netscape, Firefox { link_elem.addEventListener( 'mouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0); }, false ); link_elem.addEventListener( 'mouseout', function() { gmaps_marker_mouseout(count,image_main); }, false ); } else // IE { link_elem.attachEvent( 'onmouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0); } ); link_elem.attachEvent( 'onmouseout', function() { gmaps_marker_mouseout(count,image_main); } ); } } if ( thing_id == 2972 ) { var image_shadow = { url: 'https://www.top10fresh.com/produce/reviews/skins/default/images/misc/gmaps_shadow_3.png', // This shadow marker is normally 71 pixels wide by 40 pixels high. size: new google.maps.Size(71, 40), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base normally at (43, 40). anchor: new google.maps.Point(43, 40) }; gmaps_marker_shadow[count] = new google.maps.Marker({ position: lat_lng, map: map, icon: image_shadow, zIndex: 1 }); var image_main = { url: 'https://www.top10fresh.com/produce/reviews/google/icons/main/8/7/8/878.png', // This marker is normally 50 pixels wide by 40 pixels high. size: new google.maps.Size(50, 50), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base at (43, 40). anchor: new google.maps.Point(43, 40) }; // Shapes define the clickable region of the icon. The type defines an HTML // rect: coords is [x1,y1,x2,y2] where x1,y1 are the coordinates of the upper-left corner // of the rectangle and x2,y2 are the coordinates of the lower-right coordinates of the rectangle. var shape = { coords: [ 25, 0, 50, 50 ], type: 'rect' }; gmaps_marker_main[count] = new google.maps.Marker({ position: lat_lng, map: map, icon: image_main, shape: shape, title: 'GRUB Chico', zIndex: 100 }); var image_hover = { url: 'https://www.top10fresh.com/produce/reviews/google/icons/hover/8/7/8/878.png', // This marker is normally 50 pixels wide by 40 pixels high. size: new google.maps.Size(50, 50), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base normally at (43, 40). anchor: new google.maps.Point(43, 40) }; gmaps_marker_is_hovering[count] = 0; detail_url = 'https://www.top10fresh.com/reviews/farmers/California/sbr/date_desc/2972/grub-chico.htm'; if (detail_url) { // clicking on the marker will open the detail page for the thing; hovering will show the tooltip var clickURL = detail_url; var target = '_self'; gmaps_marker_main[count].addListener('click', function() { window.open(clickURL, target); }); } // switch icon image for hover image on marker mouseover and mouseout gmaps_marker_main[count].addListener( 'mouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0) }); gmaps_marker_main[count].addListener( 'mouseout', function() { gmaps_marker_mouseout(count,image_main) }); // add listeners to allow the tooltips to be invoked when // mousing over the known_as links in the thing listing var link_id = 'known_as_link_2972'; var link_elem = document.getElementById(link_id); if (window.addEventListener) // Mozilla, Netscape, Firefox { link_elem.addEventListener( 'mouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0); }, false ); link_elem.addEventListener( 'mouseout', function() { gmaps_marker_mouseout(count,image_main); }, false ); } else // IE { link_elem.attachEvent( 'onmouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0); } ); link_elem.attachEvent( 'onmouseout', function() { gmaps_marker_mouseout(count,image_main); } ); } } if ( thing_id == 2974 ) { var image_shadow = { url: 'https://www.top10fresh.com/produce/reviews/skins/default/images/misc/gmaps_shadow_3.png', // This shadow marker is normally 71 pixels wide by 40 pixels high. size: new google.maps.Size(71, 40), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base normally at (43, 40). anchor: new google.maps.Point(43, 40) }; gmaps_marker_shadow[count] = new google.maps.Marker({ position: lat_lng, map: map, icon: image_shadow, zIndex: 1 }); var image_main = { url: 'https://www.top10fresh.com/produce/reviews/google/icons/main/8/7/9/879.png', // This marker is normally 50 pixels wide by 40 pixels high. size: new google.maps.Size(50, 50), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base at (43, 40). anchor: new google.maps.Point(43, 40) }; // Shapes define the clickable region of the icon. The type defines an HTML // rect: coords is [x1,y1,x2,y2] where x1,y1 are the coordinates of the upper-left corner // of the rectangle and x2,y2 are the coordinates of the lower-right coordinates of the rectangle. var shape = { coords: [ 25, 0, 50, 50 ], type: 'rect' }; gmaps_marker_main[count] = new google.maps.Marker({ position: lat_lng, map: map, icon: image_main, shape: shape, title: 'Healdsburg Farm Fresh Eggs & Produce', zIndex: 100 }); var image_hover = { url: 'https://www.top10fresh.com/produce/reviews/google/icons/hover/8/7/9/879.png', // This marker is normally 50 pixels wide by 40 pixels high. size: new google.maps.Size(50, 50), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base normally at (43, 40). anchor: new google.maps.Point(43, 40) }; gmaps_marker_is_hovering[count] = 0; detail_url = 'https://www.top10fresh.com/reviews/farmers/California/sbr/date_desc/2974/healdsburg-farm-fresh-eggs--produce.htm'; if (detail_url) { // clicking on the marker will open the detail page for the thing; hovering will show the tooltip var clickURL = detail_url; var target = '_self'; gmaps_marker_main[count].addListener('click', function() { window.open(clickURL, target); }); } // switch icon image for hover image on marker mouseover and mouseout gmaps_marker_main[count].addListener( 'mouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0) }); gmaps_marker_main[count].addListener( 'mouseout', function() { gmaps_marker_mouseout(count,image_main) }); // add listeners to allow the tooltips to be invoked when // mousing over the known_as links in the thing listing var link_id = 'known_as_link_2974'; var link_elem = document.getElementById(link_id); if (window.addEventListener) // Mozilla, Netscape, Firefox { link_elem.addEventListener( 'mouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0); }, false ); link_elem.addEventListener( 'mouseout', function() { gmaps_marker_mouseout(count,image_main); }, false ); } else // IE { link_elem.attachEvent( 'onmouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0); } ); link_elem.attachEvent( 'onmouseout', function() { gmaps_marker_mouseout(count,image_main); } ); } } if ( thing_id == 2975 ) { var image_shadow = { url: 'https://www.top10fresh.com/produce/reviews/skins/default/images/misc/gmaps_shadow_3.png', // This shadow marker is normally 71 pixels wide by 40 pixels high. size: new google.maps.Size(71, 40), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base normally at (43, 40). anchor: new google.maps.Point(43, 40) }; gmaps_marker_shadow[count] = new google.maps.Marker({ position: lat_lng, map: map, icon: image_shadow, zIndex: 1 }); var image_main = { url: 'https://www.top10fresh.com/produce/reviews/google/icons/main/8/8/0/880.png', // This marker is normally 50 pixels wide by 40 pixels high. size: new google.maps.Size(50, 50), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base at (43, 40). anchor: new google.maps.Point(43, 40) }; // Shapes define the clickable region of the icon. The type defines an HTML // rect: coords is [x1,y1,x2,y2] where x1,y1 are the coordinates of the upper-left corner // of the rectangle and x2,y2 are the coordinates of the lower-right coordinates of the rectangle. var shape = { coords: [ 25, 0, 50, 50 ], type: 'rect' }; gmaps_marker_main[count] = new google.maps.Marker({ position: lat_lng, map: map, icon: image_main, shape: shape, title: 'Hicksville Acres', zIndex: 100 }); var image_hover = { url: 'https://www.top10fresh.com/produce/reviews/google/icons/hover/8/8/0/880.png', // This marker is normally 50 pixels wide by 40 pixels high. size: new google.maps.Size(50, 50), // The origin for this image is (0, 0). origin: new google.maps.Point(0, 0), // The anchor for this image is the base normally at (43, 40). anchor: new google.maps.Point(43, 40) }; gmaps_marker_is_hovering[count] = 0; detail_url = 'https://www.top10fresh.com/reviews/farmers/California/sbr/date_desc/2975/hicksville-acres.htm'; if (detail_url) { // clicking on the marker will open the detail page for the thing; hovering will show the tooltip var clickURL = detail_url; var target = '_self'; gmaps_marker_main[count].addListener('click', function() { window.open(clickURL, target); }); } // switch icon image for hover image on marker mouseover and mouseout gmaps_marker_main[count].addListener( 'mouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0) }); gmaps_marker_main[count].addListener( 'mouseout', function() { gmaps_marker_mouseout(count,image_main) }); // add listeners to allow the tooltips to be invoked when // mousing over the known_as links in the thing listing var link_id = 'known_as_link_2975'; var link_elem = document.getElementById(link_id); if (window.addEventListener) // Mozilla, Netscape, Firefox { link_elem.addEventListener( 'mouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0); }, false ); link_elem.addEventListener( 'mouseout', function() { gmaps_marker_mouseout(count,image_main); }, false ); } else // IE { link_elem.attachEvent( 'onmouseover', function() { gmaps_marker_mouseover(count,image_hover,html,15,0); } ); link_elem.attachEvent( 'onmouseout', function() { gmaps_marker_mouseout(count,image_main); } ); } } } let map; async function initMap() { // create a map object with some controls const { Map } = await google.maps.importLibrary("maps"); map = new google.maps.Map(document.getElementById('map'), { mapTypeControl: true, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.DROPDOWN_MENU, // HORIZONTAL_BAR | DROPDOWN_MENU, mapTypeIds: ['roadmap','satellite','terrain','hybrid'] }, scaleControl: true, zoomControl: true, fullscreenControl: true, streetViewControl: true }); // for each point found, extent the bounds to include it // determine the bounds of the coordinate data so that // we can construct a window that hugs the locations var bounds = new google.maps.LatLngBounds(); // index = 1, supplier_id = 2964 var point_1 = new google.maps.LatLng( 41.421463, -122.634148 ); bounds.extend( point_1 ); // index = 2, supplier_id = 2965 var point_2 = new google.maps.LatLng( 34.411617, -119.713158 ); bounds.extend( point_2 ); // index = 3, supplier_id = 2966 var point_3 = new google.maps.LatLng( 39.178963, -121.09314 ); bounds.extend( point_3 ); // index = 4, supplier_id = 2968 var point_4 = new google.maps.LatLng( 37.720139, -120.470825 ); bounds.extend( point_4 ); // index = 5, supplier_id = 2970 var point_5 = new google.maps.LatLng( 37.773232, -122.435471 ); bounds.extend( point_5 ); // index = 6, supplier_id = 2971 var point_6 = new google.maps.LatLng( 35.559727, -121.079857 ); bounds.extend( point_6 ); // index = 7, supplier_id = 2972 var point_7 = new google.maps.LatLng( 39.712395, -121.8424 ); bounds.extend( point_7 ); // index = 8, supplier_id = 2974 var point_8 = new google.maps.LatLng( 38.628181, -122.879211 ); bounds.extend( point_8 ); // index = 9, supplier_id = 2975 var point_9 = new google.maps.LatLng( 38.887917, -121.164909 ); bounds.extend( point_9 ); var bounds_center = bounds.getCenter(); map.setCenter( bounds_center ); // populate map with the marker locations // and pad the boundary of the viewing area so the markers don't touch it var padding = { bottom: 4, left: 4, right: 50, top: 40 }; map.fitBounds( bounds, padding ); // add markers with infos window. wrap the text in each window. var tooltip_html_1 = '' +'' +'' +'' +' ' +' ' +' ' +' ' +' ' +'' +' ' +' ' +'' +'' +'
' +' ' +' Gazelle Organics' +'
' +' ' +' (541) 223-3209' +' ' +'
' +' Gazelle-Callahan rd.' +' ' +'
' +' Gazelle' +', 96034' +'
' +''; createMarker( map, point_1, tooltip_html_1, 1, 2964 ); var tooltip_html_2 = '' +'' +'' +'' +' ' +'' +' ' +' ' +'' +'' +'
' +' ' +' Gildea Resource Center Urban Farm' +'
' +' ' +' (805) 963-0583' +' ' +'
' +' 930 Miramonte Drive' +' ' +'
' +' Santa Barbara' +', 93109' +'
' +''; createMarker( map, point_2, tooltip_html_2, 2, 2965 ); var tooltip_html_3 = '' +'' +'' +'' +' ' +' ' +' ' +' ' +' ' +'' +' ' +' ' +'' +'' +'
' +' ' +' Grass Valley Grains' +'
' +' ' +' (530) 273-8818' +' ' +'
' +' 13310 Nannas Way' +' ' +'
' +' Grass Valley' +', 95949' +'
' +''; createMarker( map, point_3, tooltip_html_3, 3, 2966 ); var tooltip_html_4 = '' +'' +'' +'' +' ' +'' +' ' +' ' +'' +'' +'
' +' ' +' Grass-Fed Meats' +'
' +' ' +' (209) 852-9722' +' ' +'
' +' 8191 Milpitas Rd' +' ' +'
' +' La Grange' +', 95329' +'
' +''; createMarker( map, point_4, tooltip_html_4, 4, 2968 ); var tooltip_html_5 = '' +'' +'' +'' +' ' +' ' +' ' +' ' +' ' +'' +' ' +' ' +'' +'' +'
' +' ' +' Greenhearts Family Farm CSA' +'
' +' ' +' (831) 801-0611' +' ' +'
' +' 989 Oak Street' +' ' +'
' +' San Francisco' +', 94117' +'
' +''; createMarker( map, point_5, tooltip_html_5, 5, 2970 ); var tooltip_html_6 = '' +'' +'' +'' +' ' +' ' +' ' +' ' +' ' +'' +' ' +' ' +'' +'' +'
' +' ' +' Growing Beet Organic Garden' +'
' +' ' +' (805) 234-6145' +' ' +'
' +' 2905 Burton Dr.' +' ' +'
' +' Cambria' +', 93428' +'
' +''; createMarker( map, point_6, tooltip_html_6, 6, 2971 ); var tooltip_html_7 = '' +'' +'' +'' +' ' +' ' +' ' +' ' +' ' +'' +' ' +' ' +'' +'' +'
' +' ' +' GRUB Chico' +'
' +' ' +' (530) 680-4543' +' ' +'
' +' 1525 dayton road' +' ' +'
' +' Chico' +', 95928' +'
' +''; createMarker( map, point_7, tooltip_html_7, 7, 2972 ); var tooltip_html_8 = '' +'' +'' +'' +' ' +' ' +' ' +' ' +' ' +'' +' ' +' ' +'' +'' +'
' +' ' +' Healdsburg Farm Fresh Eggs & Produce' +'
' +' ' +' (707)433-5567' +' ' +'
' +' 321 Dry Creek Rd' +' ' +'
' +' Healdsburg' +', 95448' +'
' +''; createMarker( map, point_8, tooltip_html_8, 8, 2974 ); var tooltip_html_9 = '' +'' +'' +'' +' ' +' ' +' ' +' ' +' ' +'' +' ' +' ' +'' +'' +'
' +' ' +' Hicksville Acres' +'
' +' ' +' (916) 663-2025' +' ' +'
' +' 7375 Ridge Rd.' +' ' +'
' +' Newcastle' +', 95658' +'
' +''; createMarker( map, point_9, tooltip_html_9, 9, 2975 ); } initMap(); } //