Alternate Click Handlers

Steps for creating alternate click handlers

  1. Create a marker and add it to the map
    $marker = \PHPGoogleMaps\Overlay\Marker::createFromLocation( $location,
    	array(
    		'title' => 'title',
    		'content' => 'content'
    	)
    );
    $map->addObject( &$marker );
    		
  2. Create an event listener with the alternate click handler for the marker and and add that to the map
    $click_handler = new \PHPGoogleMaps\Event\EventListener( $marker, 'click', 'function(){alert("You clicked " + '. $marker .'.content);}' );
    $map->addObject( $click_handler );
    	
  3. Optionally disable infowindows
    $map->disableInfoWindows();