setParams($params); echo '
'; include 'GoogleMapAPIv3.class.php'; $gmap = new GoogleMapAPI(); $gmap->setDivId('mymap'); //crée une div avec l'id donnée //$gmap->setDirectionDivId('route'); $gmap->setCenter('Paris France'); // Adresse du centre par défaut $gmap->setEnableWindowZoom(true); // Permet de zoomer (trop important !) $gmap->setEnableAutomaticCenterZoom(false); // FALSE ! ou sinon le setCenter ne sert à rien ! //$gmap->setDisplayDirectionFields(false); $gmap->setSize('400px','400px'); // La taille... duh ! $gmap->setZoom(11); // Le zoom (+ il est haut, plus le zoom est proche) $gmap->setLang('fr'); // La langue par défaut $gmap->setDefaultHideMarker(false); // Cache les markers ? $gmap->generate(); // Génère le JS echo $gmap->getGoogleMap(); echo '
'; } private function setParams($params){ $this->params = $params; } public static function start($params){ $gmap = new gmap($params); } public function setVisibility($visibility){ // Saving the position and z-index of the note: $xmla = simplexml_load_file('../'.AccueilModules::CONFIG_FILE); $path = $xmla->xpath("//item[@id='gmap']"); $path[0]->visibility = $visibility; $xmla->asXML('../'.AccueilModules::CONFIG_FILE); echo "ok"; } public static function updateConfig($updated){ foreach ($updated as $what=>$withWhat){ if(in_array($what, self::$paramsList)){ call_user_func(array(get_class(), "set".ucfirst($what)), $withWhat); } } } }