id_dom = "facette"; $this->ids=$ids; $this->location_objects = $tab_locations; $this->ids_surloc = $ids_surloc; $this->surlocation_objects = $tab_surlocations; $this->editable = false; $this->ajax = false; $this->type=$type; if (count($ids)) { $this->objects[] = array( 'layer' => "location", 'ids' => $this->ids ); } if (count($ids_surloc)) { $this->objects[] = array( 'layer' => "sur_location", 'ids' => $this->$ids_surloc ); } $this->fetch_datas(); $this->model = new map_model(null, $this->objects,$opac_map_max_holds); $this->model->set_mode("search_location"); } public function get_json_informations(){ global $opac_url_base; global $opac_map_max_holds; global $dbh; $map_hold = $this->get_bounding_box(); if($map_hold){ $coords = $map_hold->get_coords(); if(!count($coords)) { return ""; } return "mode:\"facette\", type:\"" . $this->type . "\", initialFit: [ ".self::get_coord_initialFit($coords)."], layers : ".json_encode($this->model->get_json_informations(false, $opac_url_base,$this->editable)).", data : " . json_encode(array_merge($this->location_objects,$this->surlocation_objects)); }else{ return ""; } } public function get_map_controler_name(){ return "apps/map/map_location_facette_controler"; } static public function get_map_facette_location($ids_loc, $tab_locations, $ids_surloc, $tab_surlocations) { global $msg; if(!count($ids_loc) && !count($ids_surloc)){ return ''; } if(count($ids_loc)==1 && !count($ids_surloc)){ return ''; } $map = new map_facette_controler(TYPE_LOCATION, $ids_loc, $tab_locations, $ids_surloc, $tab_surlocations); return "".$msg['record_expl_map_location']. "
". $map->get_map()."
"; } public function get_map_size() { global $opac_map_size_location_facette; global $charset; $size=explode("*",$opac_map_size_location_facette); if(count($size)!=2) { $map_size="width:100%; height:200px;"; } else { if (is_numeric($size[0])) { $size[0] = $size[0] . "px"; } if (is_numeric($size[1])) { $size[1] = $size[1] . "px"; } $map_size= "width:".$size[0]."; height:".$size[1].";"; } if ($charset != "utf8") { $map_size = utf8_encode($map_size); } return $map_size; } }