Esempio n. 1
0
 private function initializeMap(MapDataController $dataController, $fullscreen = FALSE)
 {
     $placemarks = $dataController->getSelectedPlacemarks();
     $imgController = $this->getImageController();
     foreach ($placemarks as $placemark) {
         $imgController->addPlacemark($placemark);
     }
     // override point for current zoom level
     if (isset($this->args['zoom'])) {
         $zoomLevel = $this->args['zoom'];
     } else {
         $zoomLevel = $dataController->getDefaultZoomLevel();
     }
     // override point for where map should be centered
     if (isset($this->args['center'])) {
         $center = filterLatLon($this->getArg('center'));
     } elseif (isset($this->args['lat'], $this->args['lon'])) {
         $center = array('lat' => $this->getArg('lat'), 'lon' => $this->getArg('lon'));
     }
     if (isset($center)) {
         $imgController->setCenter($center);
     }
     if (isset($zoomLevel) && $zoomLevel !== null) {
         $imgController->setZoomLevel($zoomLevel);
     }
     if (!$fullscreen) {
         $this->assign('fullscreenURL', $this->buildBreadcrumbURL('fullscreen', $this->args, false));
         if (!$imgController->isStatic()) {
             $this->addInlineJavascriptFooter("\n hideMapTabChildren();\n");
         }
     } else {
         $this->assign('detailURL', $this->buildBreadcrumbURL('detail', $this->args, false));
     }
     $this->assign('fullscreen', $fullscreen);
     $this->assign('isStatic', $imgController->isStatic());
     $this->initializeMapElements('mapimage', $imgController);
     // call the function that updates the image size
     if ($imgController->isStatic()) {
         $this->addJavascriptStaticMap();
     } else {
         $this->addJavascriptDynamicMap();
     }
 }