ReadMultiMapInfo() 공개 정적인 메소드

fn ReadMapInfo
public static ReadMultiMapInfo ( )
예제 #1
0
파일: GeoMap.php 프로젝트: nidzix/Newscoop
 /**
  * Gives the body map-info and point-list part for the map front end presentation
  *
  * @param int $p_languageId
  * @param array $p_constraints
  * @param array $p_options
  * @param int $p_offset
  * @param int $p_limit
  * @param int $p_rank
  *    The rank of the current multi-map, used to make unique ids
  *
  * @return array
  */
 public static function GetMultiMapTagListData($p_languageId, $p_constraints, $p_options, $p_offset, $p_limit, $p_rank = 0)
 {
     $f_language_id = (int) $p_languageId;
     $map_suffix = '_' . 'multimap' . '_' . $f_language_id . '_' . $p_rank;
     $preview = true;
     $text_only = true;
     $geo_map_usage = Geo_Map::ReadMultiMapInfo();
     $points = null;
     $pois_loaded = false;
     if (is_array($p_options)) {
         if (array_key_exists('pois_retrieved', $p_options)) {
             $pois_loaded = $p_options['pois_retrieved'];
         }
     }
     if (!$pois_loaded) {
         $leftOperand = 'as_array';
         $rightOperand = true;
         $operator = new Operator('is', 'php');
         $constraint = new ComparisonOperation($leftOperand, $operator, $rightOperand);
         $p_constraints[] = $constraint;
         $leftOperand = 'active_only';
         $rightOperand = true;
         $operator = new Operator('is', 'php');
         $constraint = new ComparisonOperation($leftOperand, $operator, $rightOperand);
         $p_constraints[] = $constraint;
         $leftOperand = 'text_only';
         $rightOperand = true;
         $operator = new Operator('is', 'php');
         $constraint = new ComparisonOperation($leftOperand, $operator, $rightOperand);
         $p_constraints[] = $constraint;
         $leftOperand = 'language';
         $rightOperand = $p_languageId;
         $operator = new Operator('is', 'php');
         $constraint = new ComparisonOperation($leftOperand, $operator, $rightOperand);
         $p_constraints[] = $constraint;
         $leftOperand = 'constrained';
         $rightOperand = true;
         $operator = new Operator('is', 'php');
         $constraint = new ComparisonOperation($leftOperand, $operator, $rightOperand);
         $p_constraints[] = $constraint;
         $poi_count = 0;
         $points = array();
         $point_objs = Geo_MapLocation::GetListExt($p_constraints, (array) null, $p_offset, $p_limit, $poi_count, false, $points);
     } else {
         $points = $p_constraints;
     }
     $poi_info = array('pois' => $points, 'map' => $geo_map_usage);
     $pind = 0;
     foreach ($poi_info['pois'] as $rank => $poi) {
         $cur_lon = $poi['longitude'];
         $cur_lat = $poi['latitude'];
         $center_poi = "if (window.map_prepared) {geo_object{$map_suffix}.center_lonlat({$cur_lon}, {$cur_lat});} point_large_map_center" . $map_suffix . "({$pind}, false);";
         $select_poi = "if (window.map_prepared) {geo_object{$map_suffix}.select_poi({$pind});} point_large_map_center" . $map_suffix . "({$pind}, true);";
         $poi_info['pois'][$rank]['center'] = $center_poi;
         $poi_info['pois'][$rank]['open'] = $select_poi;
         $pind += 1;
     }
     return (array) $poi_info;
 }