From 002a7b037f28df996e4322623cc44a1a86d5cb86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20de=20la=20Concepci=C3=B3n=20Sanz?= Date: Wed, 27 Jan 2010 16:10:14 +0000 Subject: [PATCH] =?UTF-8?q?2010-01-27=20=20Pablo=20de=20la=20Concepci?= =?UTF-8?q?=C3=B3n=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * include/functions_gis.php: Updated getMapConf to work with the new database model; git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2313 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/include/functions_gis.php | 27 +++++++++-------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index d50027c644..ef8805d5e9 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2010-01-27 Pablo de la Concepción + + * include/functions_gis.php: Updated getMapConf to work with the new + database model; + 2010-01-27 Miguel de Dios * include/functions_gis.php: add the prototipe of function "saveMap2" at the moment for to develop in next hours or days. diff --git a/pandora_console/include/functions_gis.php b/pandora_console/include/functions_gis.php index 76871796bc..59588a1817 100644 --- a/pandora_console/include/functions_gis.php +++ b/pandora_console/include/functions_gis.php @@ -292,21 +292,18 @@ function addPointPath($layerName, $lat, $lon, $color, $manual = 1, $id) { function getMaps() { return get_db_all_rows_in_table ('tgis_map', 'map_name'); } - +/** + * Gets the configuration of all the base layers of a map + * + * @param $idMap: Map identifier of the map to get the configuration + * + * @return An array of arrays of configuration parameters + */ function getMapConf($idMap) { - $confsEncode = get_db_all_rows_sql('SELECT * FROM tgis_map_connection WHERE tgis_map_id_tgis_map = ' . $idMap); - - $confsDecode = array(); - - if ($confsEncode !== false) { - foreach ($confsEncode as $confEncode) { - $temp = json_decode($confEncode['conection_data'], true); - - $confsDecode[$temp['type']][] = $temp['content']; - } - } - - return $confsDecode; + $mapConfs= get_db_all_rows_sql('SELECT tconn.* FROM tgis_map_connection AS tconn, tgis_map_has_tgis_map_connection AS trel + WHERE trel.tgis_map_connection_id_tmap_connection = tconn.id_tmap_connection AND trel.tgis_map_id_tgis_map = ' . $idMap); + print_r($mapConfs); + return $mapConfs; } function getLayers($idMap) { @@ -541,7 +538,6 @@ function saveMap2($map_name, $map_initial_longitude, $map_initial_latitude, $map_default_longitude, $map_default_latitude, $map_default_altitude, $map_group_id, $map_connection_list, $arrayLayers) { } -?> /** * Get the configuration parameters of a map connection @@ -589,4 +585,3 @@ function getAgentMap($agent_id, $heigth, $width, $show_history = false, $history addPoint("layer_for_agent_".$agent_name, $agent_name, $agent_position['last_latitude'], $agent_position['last_longitude'], $agent_icon); } ?> -