';
contentString+= '
';
contentString+= '
' + markers[j].nom_du_produit + '
';
if ( '' != markers[j].price ) {
contentString+= '' + markers[j].price + '';
}
contentString+= '
En savoir plus';
contentString+= '
';
contentString+= '';
const marker = new google.maps.Marker( {
position: markers[j].latlng,
map: map,
icon: 'https://www.yourlocaleye.com/wp-content/themes/yle/img/marker-yle.png'
} );
bounds.extend( marker.position );
const infowindow = new google.maps.InfoWindow( {
content: contentString,
maxWidth: 220
} );
marker.addListener( 'mouseover', function () {
closeOtherInfo();
infowindow.open( marker.get( 'map' ), marker );
InforObj[0] = infowindow;
});
marker.addListener( 'click', function () {
closeOtherInfo();
infowindow.open( marker.get( 'map' ), marker );
InforObj[0] = infowindow;
});
// marker.addListener( 'mouseout', function () {
// closeOtherInfo();
// infowindow.close( marker.get( 'map' ), marker );
// InforObj[0] = infowindow;
// });
}
map.fitBounds( bounds );
}
function closeOtherInfo() {
if ( InforObj.length > 0 ) {
InforObj[0].set( 'marker', null );
InforObj[0].close();
InforObj.length = 0;
}
}