//
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 == 2603 )
{
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/5/5/1/551.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: 'Chico CFM',
zIndex: 100
});
var image_hover = {
url: 'https://www.top10fresh.com/produce/reviews/google/icons/hover/5/5/1/551.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/2603/chico-cfm.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_2603';
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 == 2607 )
{
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/5/5/5/555.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: 'Chowchilla Farmers Market',
zIndex: 100
});
var image_hover = {
url: 'https://www.top10fresh.com/produce/reviews/google/icons/hover/5/5/5/555.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/2607/chowchilla-farmers-market.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_2607';
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 == 2608 )
{
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/5/5/6/556.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: 'Chula Vista CFM',
zIndex: 100
});
var image_hover = {
url: 'https://www.top10fresh.com/produce/reviews/google/icons/hover/5/5/6/556.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/2608/chula-vista-cfm.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_2608';
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 == 2609 )
{
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/5/5/7/557.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: 'Chula Vista Saturday Farmers Market',
zIndex: 100
});
var image_hover = {
url: 'https://www.top10fresh.com/produce/reviews/google/icons/hover/5/5/7/557.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/2609/chula-vista-saturday-farmers-market.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_2609';
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 == 2610 )
{
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/5/5/8/558.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: 'Chula Vista Eastlake CFM',
zIndex: 100
});
var image_hover = {
url: 'https://www.top10fresh.com/produce/reviews/google/icons/hover/5/5/8/558.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/2610/chula-vista-eastlake-cfm.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_2610';
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 = 2603
var point_1 = new google.maps.LatLng( 39.728889, -121.837059 );
bounds.extend( point_1 );
// index = 2, supplier_id = 2607
var point_2 = new google.maps.LatLng( 37.120075, -120.26355 );
bounds.extend( point_2 );
// index = 3, supplier_id = 2608
var point_3 = new google.maps.LatLng( 32.640305, -117.079651 );
bounds.extend( point_3 );
// index = 4, supplier_id = 2609
var point_4 = new google.maps.LatLng( 32.642075, -116.994293 );
bounds.extend( point_4 );
// index = 5, supplier_id = 2610
var point_5 = new google.maps.LatLng( 32.657436, -116.982918 );
bounds.extend( point_5 );
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 = ''
+''
+''
+''
+' '
+' '
+'  | '
+' | '
+' '
+''
+' '
+' '
+' Chico CFM'
+' | '
+'
'
+''
+' '
+' '
+' (530)893-0893'
+' '
+' '
+' 2d & Wall Streets'
+' '
+' '
+' Chico'
+', 95928'
+' |
'
+'
'
+'';
createMarker( map, point_1, tooltip_html_1, 1, 2603 );
var tooltip_html_2 = ''
+''
+''
+''
+' '
+' '
+'  | '
+' | '
+' '
+''
+' '
+' '
+' Chowchilla Farmers Market'
+' | '
+'
'
+''
+' '
+' '
+' (209)389-0430'
+' '
+' '
+' 600 Robertson Blvd. & 6th Street'
+' '
+' '
+' Chowchilla'
+', 93610'
+' |
'
+'
'
+'';
createMarker( map, point_2, tooltip_html_2, 2, 2607 );
var tooltip_html_3 = ''
+''
+''
+''
+' '
+''
+' '
+' '
+' Chula Vista CFM'
+' | '
+'
'
+''
+' '
+' '
+' (619)422-1982'
+' '
+' '
+' 3d & Center Streets'
+' '
+' '
+' Chula Vista'
+', 91910'
+' |
'
+'
'
+'';
createMarker( map, point_3, tooltip_html_3, 3, 2608 );
var tooltip_html_4 = ''
+''
+''
+''
+' '
+''
+' '
+' '
+' Chula Vista Saturday Farmers Market'
+' | '
+'
'
+''
+' '
+' '
+' (619)237-1632'
+' '
+' '
+' 900 Otay Lakes Road'
+' '
+' '
+' Chula Vista'
+', 91912'
+' |
'
+'
'
+'';
createMarker( map, point_4, tooltip_html_4, 4, 2609 );
var tooltip_html_5 = ''
+''
+''
+''
+' '
+''
+' '
+' '
+' Chula Vista Eastlake CFM'
+' | '
+'
'
+''
+' '
+' '
+' (858) 272-7054'
+' '
+' '
+' 1955 Hillside Dr.'
+' '
+' '
+' Chula Vista'
+', 91913'
+' |
'
+'
'
+'';
createMarker( map, point_5, tooltip_html_5, 5, 2610 );
}
initMap();
}
//