	var map;
	var markersArray = [];
	var poisArray = [];
	var speciesArray = []; 
	var markersDataArray = [];
	var infoWindowArray = [];
	var updateWindowArray = [];
	var side_bar_html = "";
	var activeMarker, lastActiveMarker; 
	var add_marker_permission = 0;
	var markerZIndex = 1

	 
	initialize();
	
	function initialize() {
		
	
		
		displayMap();
		
		var Marker='undefined';
			
		google.maps.event.addListener(map, "click", function(event) {
			
				
			
				var shadow = new google.maps.MarkerImage("http://localhost/wedkoholik/web/bundles/frontend/images/shadow.png",
	    	        new google.maps.Size(79.0, 57.0),
	    	        new google.maps.Point(0, 0),
	    	        new google.maps.Point(25.0, 56.0)
	    	    );
				
				if(Marker=='undefined')
				{
					Marker = new google.maps.Marker({
			    	      map: map,
			    	      position: event.latLng,
			    	      icon: "http://localhost/wedkoholik/web/bundles/frontend/images/map_point2.png",
			    	      shadow: shadow,
			    	      draggable: true,
			    	      
				    });
				}else{
					Marker.setMap(null);
					
					Marker = new google.maps.Marker({
			    	      map: map,
			    	      position: event.latLng,
			    	      icon: "http://localhost/wedkoholik/web/bundles/frontend/images/map_point2.png",
			    	      shadow: shadow,
			    	      draggable: true,
					   });
					
				}
				
				document.getElementById("form_lat").value = Marker.getPosition().lat();
				document.getElementById("form_lng").value = Marker.getPosition().lng();
			
		});
		 	
	}
	
	
	function displayMap() {
		
		
		  var mapOptions = {
				    zoom: 12,
				    center : new google.maps.LatLng(47.6145, -122.3418),
				    mapTypeId: google.maps.MapTypeId.ROADMAP,
				    mapTypeControl: true,
				    mapTypeControlOptions: {
				        style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
				        position: google.maps.ControlPosition.TOP_RIGHT
				    },
				    
				    zoomControl: true,
				    zoomControlOptions: {
				        style: google.maps.ZoomControlStyle.LARGE,
				        position: google.maps.ControlPosition.RIGHT_CENTER
				    },
				    scaleControl: true,
				    scaleControlOptions: {
				    	position: google.maps.ControlPosition.BOTTOM_CENTER
				    },
				    
				  }

		
		  map = new google.maps.Map(document.getElementById("map_canvas"),
			      mapOptions);

	}
	
	function centerMap(LatLng = "47.6145, -122.3418") {
		map.panTo(LatLng);	
	}