예제 #1
0
 /**
  * Converts the data in the coordinates parameter to JSON-ready objects.
  * These get stored in the locations parameter, and the coordinates on gets deleted.
  * 
  * @since 1.0
  * 
  * @param array &$params
  * @param SMQueryHandler $queryHandler
  */
 protected function handleMarkerData(array &$params, SMQueryHandler $queryHandler)
 {
     if (is_object($params['centre'])) {
         $params['centre'] = $params['centre']->getJSONObject();
     }
     $iconUrl = MapsMapper::getFileUrl($params['icon']);
     $visitedIconUrl = MapsMapper::getFileUrl($params['visitedicon']);
     $params['locations'] = $this->getJsonForStaticLocations($params['staticlocations'], $params, $iconUrl, $visitedIconUrl);
     unset($params['staticlocations']);
     $this->addShapeData($queryHandler->getShapes(), $params, $iconUrl, $visitedIconUrl);
     if ($params['format'] === 'openlayers') {
         $params['layers'] = MapsDisplayMapRenderer::evilOpenLayersHack($params['layers']);
     }
 }
예제 #2
0
 /**
  * Renders and returns the output.
  * @see ParserHook::render
  * 
  * @since 0.7
  * 
  * @param array $parameters
  * 
  * @return string
  */
 public function render(array $parameters)
 {
     // Get the instance of the service class.
     $service = MapsMappingServices::getServiceInstance($parameters['mappingservice'], $this->getName());
     $mapClass = new MapsDisplayMapRenderer($service);
     $fullParams = $this->validator->getParameters();
     if (array_key_exists('zoom', $fullParams) && $fullParams['zoom']->wasSetToDefault() && count($parameters['coordinates']) > 1) {
         $parameters['zoom'] = false;
     }
     global $egMapsEnableCategory;
     if ($egMapsEnableCategory) {
         $this->parser->addTrackingCategory('maps-tracking-category');
     }
     return $mapClass->renderMap($parameters, $this->parser);
 }