/**
  * GMapInfoWindow sample
  *
  * @author Vincent Guillon <*****@*****.**>
  * @since 2009-10-02 17:16:44
  */
 public function executeSample3()
 {
     // Initialize the google map
     $gMap = new GMap();
     $gMap->setZoom(13);
     $gMap->setCenter(-12.461334, 130.841904);
     // Create GMapInfoWindow
     $info_window = new GMapInfoWindow('<div>Your HTML content here !</div>');
     // Create marker
     $marker = new GMapMarker(-12.461334, 130.841904, array('title' => '"Darwin"'));
     $marker->addHtmlInfoWindow($info_window);
     $gMap->addMarker($marker);
     $this->gMap = $gMap;
     $this->setTemplate('sample1');
     // END OF ACTION
     $this->message = 'Simple GMapInfoWindow : click marker to open info window';
     $this->action_source = $this->functionToString('executeSample3');
 }
Example #2
0
  /**
   *
   * calculates the center of the markers linked to the map
   *
   * @return GMapCoord
   * @author fabriceb
   * @since 2009-05-02
   */
  public function getMarkersCenterCoord()
  {

    return GMapMarker::getCenterCoord($this->markers);
  }
<?php

//
// Initialisation
//
define('GMAP_LIB_PATH', dirname(__FILE__) . '/../../lib/');
require_once GMAP_LIB_PATH . 'GMap.class.php';
//
// Controller
//
$gMap = new GMap();
$gMap->setZoom(4);
$gMap->setCenter(-25.363882, 131.044922);
$gMap->setHeight('500');
$gMap->setWidth('100%');
$marker = new GMapMarker(-25.363882, 131.044922, array('title' => '"Hello World!"'));
$marker->addEvent(new GMapEvent('click', 'map.set_zoom(8);'));
$gMap->addMarker($marker);
$gMap->addEvent(new GMapEvent('zoom_changed', 'setTimeout(moveToDarwin, 1500);'));
//
// View
//
?>

<?php 
require_once GMAP_LIB_PATH . 'helper/GMapHelper.php';
?>

<html>
  <head>
    <?php