Geo_Map::LoadMapData PHP Метод

LoadMapData() публичный статический Метод

Load map data
public static LoadMapData ( integer $p_mapId, integer $p_languageId, integer $p_articleNumber, $p_preview = false, $p_textOnly = false ) : array
$p_mapId integer
$p_languageId integer
$p_articleNumber integer
Результат array
    public static function LoadMapData($p_mapId, $p_languageId, $p_articleNumber, $p_preview = false, $p_textOnly = false)
    {
        $poi_count = 0;
        $p_constraints = array();
        $leftOperand = 'as_array';
        $rightOperand = true;
        $operator = new Operator('is', 'php');
        $constraint = new ComparisonOperation($leftOperand, $operator, $rightOperand);
        $p_constraints[] = $constraint;
        $leftOperand = 'active_only';
        $rightOperand = $p_preview;
        $operator = new Operator('is', 'php');
        $constraint = new ComparisonOperation($leftOperand, $operator, $rightOperand);
        $p_constraints[] = $constraint;
        $leftOperand = 'text_only';
        $rightOperand = $p_textOnly;
        $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 = 'map';
        $rightOperand = $p_mapId;
        $operator = new Operator('is', 'php');
        $constraint = new ComparisonOperation($leftOperand, $operator, $rightOperand);
        $p_constraints[] = $constraint;
        $pois = array();
        $poi_objs = Geo_MapLocation::GetListExt($p_constraints, (array) null, 0, 0, $poi_count, false, $pois);
        return array('pois' => $pois, 'map' => Geo_Map::ReadMapInfo('map', (int) $p_mapId));
    }

Usage Example

Пример #1
0
 /**
  * Gives the body map-info and point-list part for the map front end presentation
  *
  * @param int $p_articleNumber
  * @param int $p_languageId
  *
  * @return array
  */
 public static function GetMapTagListData($p_articleNumber, $p_languageId)
 {
     $f_article_number = (int) $p_articleNumber;
     $f_language_id = (int) $p_languageId;
     $map_suffix = '_' . $f_article_number . '_' . $f_language_id;
     $map_id = Geo_Map::GetMapIdByArticle($f_article_number);
     $preview = true;
     $text_only = true;
     $poi_info = Geo_Map::LoadMapData($map_id, $f_language_id, $f_article_number, $preview, $text_only);
     $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;
 }
All Usage Examples Of Geo_Map::LoadMapData