Geo_Map::GetMultiMapTagListData PHP Method

GetMultiMapTagListData() public static method

Gives the body map-info and point-list part for the map front end presentation
public static GetMultiMapTagListData ( integer $p_languageId, array $p_constraints, array $p_options, integer $p_offset, integer $p_limit, integer $p_rank ) : array
$p_languageId integer
$p_constraints array
$p_options array
$p_offset integer
$p_limit integer
$p_rank integer 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;
    }