// JavaScript Document

// ============================================== INIT MAP ==============================================

function initialize(codeLanguage,myLat,myLng) {
	
  var stylez = [
		{
		 featureType: "water",
		 elementType: "all",
		 stylers: [
		 	{ saturation: -93 },
		 	{ lightness: 23 } 
		 ]
		},
		{
		 featureType: "landscape.man_made",
		 elementType: "all",
		 stylers: [
		 	{ saturation: -90 },
		 	{ lightness: 39 }
		 ]
		},
		{
		 featureType: "administrative.country",
		 elementType: "all", 
		 stylers: [ 
		 	{ saturation: -98 },
		 	{ lightness: -2 }
		 ]
		},
		{
		 featureType: "road.highway",
		 elementType: "all", 
		 stylers: [ 
		 	{ saturation: -100 },
		 	{ lightness: 4 }
		 ]
		},
		{
		 featureType: "road.arterial",
		 elementType: "all", 
		 stylers: [
		 	{ saturation: -97 },
		 	{ lightness: 16 }
		 ]
		},
		{
		 featureType: "road.local",
		 elementType: "all", 
		 stylers: [ 
		 	{ hue: "#00ddff" },
		 	{ saturation: -97 },
		 	{ lightness: 33 },
		 	{ gamma: 0.9 }
		 ]
		},
		{
		 featureType: "transit.station.rail",
		 elementType: "all", 
		 stylers: [ 
		 	{ hue: "#91ff00" },
		 	{ lightness: 7 },
		 	{ saturation: 2 }
		 ]
		},
		{
		 featureType: "poi.park",
		 elementType: "all", 
		 stylers: [ 
		 	{ saturation: -96 },
		 	{ lightness: 40 }
		 ]
		},
		{
		 featureType: "poi.medical",
		 elementType: "all", 
		 stylers: [ 
		 	{ saturation: -100 },
		 	{ lightness: 14 }
		 ]
		},
		{
		 featureType: "poi.government",
		 elementType: "all", 
		 stylers: [ 
		 	{ saturation: -99 },
		 	{ lightness: 18 }
		 ]
		},
		{
		 featureType: "poi.school",
		 elementType: "all", 
		 stylers: [ 
		 	{ lightness: 44 },
		 	{ saturation: -100 }
		 ]
		},
		{
		 featureType: "landscape.natural",
		 elementType: "all", 
		 stylers: [ 
		 	{ saturation: -100 },
		 	{ lightness: 21 }
		 ]
		},
		{
		 featureType: "landscape.man_made",
		 elementType: "all", 
		 stylers: [ 
		 	{ saturation: -98 } 
		 ]
		},
		{
		 featureType: "poi.business",
		 elementType: "all", 
		 stylers: [
		 	{ saturation: -100 },
		 	{ lightness: 31 }
		 ]
		}
  ];
	
	
	var myLatLng = new google.maps.LatLng(myLat, myLng);	
	  
	var myOptions = {
		  zoom: 16,
		  center: myLatLng,
		  mapTypeControl: false,
			zoomControl: true,
			zoomControlOptions: {
				style: google.maps.ZoomControlStyle.LARGE
			},
			streetViewControl: false,
		  mapTypeId: google.maps.MapTypeId.ROADMAP
	};
	var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  
  var image = 'img/pointeur-halle-secheron.png';
  var marker = new google.maps.Marker({
	  position: myLatLng, 
	  map: map,
	  icon: image
  });
  
  var contentString = "<div class='mapInfobulleBloc'><div class='mapInfobulleBlocTitre'>Halle Sécheron</div><p>14 avenue de Sécheron<br>Genève - Suisse<br><br>Dîners de gala, Cocktails, Lancements de produits, Soirées d'entreprises, Évènements VIP, Défilés de mode, Congrès, Conférences</p></div>";
	var infowindow = new google.maps.InfoWindow({
		content: contentString,
		pixelOffset: {width:10, height:45}
	});

	google.maps.event.addListener(marker, 'click', function() {
		infowindow.open(map,marker);
	});

  var styledMapOptions = {
      name: "conseils-cuisines"
  }

  var jayzMapType = new google.maps.StyledMapType(stylez, styledMapOptions);

  map.mapTypes.set('conseilscuisines', jayzMapType);
  map.setMapTypeId('conseilscuisines');
	
}

// ============================================== INIT MAP ==============================================

