public function addEvent($marker, $infoWindow, $open = false) {
		$this->map .= "
			google.maps.event.addListener(gMarkers" . static::$mapCount . "[{$marker}], 'click', function() {
				gInfoWindows" . static::$mapCount . "[$infoWindow].open(" . $this->name() . ", this);
			});
		";
		if ($open) {
			$event = 'gInfoWindows' . static::$mapCount . "[$infoWindow].open(" . $this->name() .
				', gMarkers' . static::$mapCount . '[' . $marker . ']);';
			$this->addCustom($event);
		}
	}
public function addEvent($marker, $infoWindow, $open = false) {
		$this->map .= "
			google.maps.event.addListener(gMarkers" . static::$mapCount . "[{$marker}], 'click', function() {
				gInfoWindows" . static::$mapCount . "[$infoWindow].open(" . $this->name() . ", this);
			});
		";
		if ($open) {
			$event = 'gInfoWindows' . static::$mapCount . "[$infoWindow].open(" . $this->name() .
				', gMarkers' . static::$mapCount . '[' . $marker . ']);';
			$this->addCustom($event);
		}
	}
public function addEvent ( $ marker , $ infoWindow , $ open = false ) { $ this -> map .= "
			google.maps.event.addListener(gMarkers" . static :: $ mapCount . "[{$marker}], 'click', function() {
				gInfoWindows" . static :: $ mapCount . "[$infoWindow].open(" . $ this -> name ( ) . ", this);
			});
		" ; if ( $ open ) { $ event = 'gInfoWindows' . static :: $ mapCount . "[$infoWindow].open(" . $ this -> name ( ) . ', gMarkers' . static :: $ mapCount . '[' . $ marker . ']);' ; $ this -> addCustom ( $ event ) ; } }
Add event to open marker on click.

@param int $marker
@param int $infoWindow
@param bool $open Also open it right away.
@return void
Add event to open marker on click .