From 676532f53c3b90c9124914ca05ee8686e0a7f03b Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Thu, 28 Jan 2010 14:44:57 +0000 Subject: [PATCH] 2010-01-27 Miguel de Dios * operation/gis_maps/ajax.php: clean source code, erased comment lines. * include/functions_gis.php, godmode/gis_maps/configure_gis_map.php: clean source, change the name of saveMap2 to saveMap. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2316 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 ++ .../godmode/gis_maps/configure_gis_map.php | 2 +- pandora_console/include/functions_gis.php | 79 +------------------ pandora_console/operation/gis_maps/ajax.php | 19 ----- 4 files changed, 9 insertions(+), 98 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index a60999a1ff..e3a2122bf9 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2010-01-27 Miguel de Dios + + * operation/gis_maps/ajax.php: clean source code, erased comment lines. + + * include/functions_gis.php, godmode/gis_maps/configure_gis_map.php: clean + source, change the name of saveMap2 to saveMap. + 2010-01-27 Pablo de la ConcepciĆ³n * include/functions_gis.php: Modiffied addPoint and addPointExtent to diff --git a/pandora_console/godmode/gis_maps/configure_gis_map.php b/pandora_console/godmode/gis_maps/configure_gis_map.php index aa5f9056f5..9b3b9c6f45 100644 --- a/pandora_console/godmode/gis_maps/configure_gis_map.php +++ b/pandora_console/godmode/gis_maps/configure_gis_map.php @@ -58,7 +58,7 @@ switch ($action) { $arrayLayers[] = JSON_decode($_POST['layer_values_' . $layerID], true); } - saveMap2($map_name, $map_initial_longitude, $map_initial_latitude, + saveMap($map_name, $map_initial_longitude, $map_initial_latitude, $map_initial_altitude, $map_zoom_level, $map_background, $map_default_longitude, $map_default_latitude, $map_default_altitude, $map_group_id, $map_connection_list, $arrayLayers); diff --git a/pandora_console/include/functions_gis.php b/pandora_console/include/functions_gis.php index 4b92e00316..fce69dee86 100644 --- a/pandora_console/include/functions_gis.php +++ b/pandora_console/include/functions_gis.php @@ -455,83 +455,6 @@ function saveMapConnection($mapConnection_name, $mapConnection_group, return $returnQuery; } -function saveMap($conf, $baselayers, $layers) { - $return = false; - - //TODO validation data - - //BY DEFAULT TODO need code and change db - $articaLongitude = -3.708187; - $articaLatitude = 40.42056; - $articaAltitude = 0; - $defaultControl = array ('type' => 'controls', - 'content' => array('Navigation', 'PanZoomBar', 'ScaleLine') - ); - //BY DEFAULT TODO need code and change db - - $idMap = process_sql_insert('tgis_map', - array( - 'map_name' => $conf['name'], - 'initial_longitude' => $articaLongitude, - 'initial_latitude' => $articaLatitude, - 'initial_altitude' => $articaAltitude, - 'zoom_level' => $conf['initial_zoom'], - 'group_id' => $conf['group'] - - ) - ); - $zoom = array("type" => "numLevelsZoom","content" => $conf['numLevelsZoom']); - - process_sql_insert('tgis_map_connection', - array( - 'conection_data' => json_encode($defaultControl), - 'tgis_map_id_tgis_map' => $idMap - ) - ); - - process_sql_insert('tgis_map_connection', - array( - 'conection_data' => json_encode($zoom), - 'tgis_map_id_tgis_map' => $idMap - ) - ); - - foreach ($baselayers as $baselayer) { - switch ($baselayer['type']) { - case 'osm': - $temp = array( - 'type' => 'baselayer', - 'content' => array( - 'typeBaseLayer' => 'OSM', - 'url' => $baselayer['url'], - 'default' => $baselayer['default'] - ) - ); - - process_sql_insert('tgis_map_connection', - array( - 'conection_data' => json_encode($temp), - 'tgis_map_id_tgis_map' => $idMap - ) - ); - break; - } - } - - foreach($layers as $layer) { - process_sql_insert('tgis_map_layer', - array( - 'layer_name' => $layer['name'], - 'view_layer' => $layer['visible'], - 'tgis_map_id_tgis_map' => $idMap, - 'tgrupo_id_grupo' => $layer['group'] - ) - ); - } - - return $return; -} - /** * Save the map into DB, tgis_map and with id_map save the connetions in * tgis_map_has_tgis_map_connection, and with id_map save the layers in @@ -551,7 +474,7 @@ function saveMap($conf, $baselayers, $layers) { * @param $map_connection_list * @param $arrayLayers */ -function saveMap2($map_name, $map_initial_longitude, $map_initial_latitude, +function saveMap($map_name, $map_initial_longitude, $map_initial_latitude, $map_initial_altitude, $map_zoom_level, $map_background, $map_default_longitude, $map_default_latitude, $map_default_altitude, $map_group_id, $map_connection_list, $arrayLayers) { diff --git a/pandora_console/operation/gis_maps/ajax.php b/pandora_console/operation/gis_maps/ajax.php index 971e96a6d9..2ca3bd6a39 100644 --- a/pandora_console/operation/gis_maps/ajax.php +++ b/pandora_console/operation/gis_maps/ajax.php @@ -81,23 +81,4 @@ switch ($opt) { break; } -// $returnJSON = array(); -// -// $returnJSON['correct'] = 1; -// $returnJSON['content'] = ''; -// -// //echo json_encode($returnJSON); -// break; -//} -// -//$listPoints = get_db_all_rows_sql('SELECT * FROM tgis_data WHERE tagente_id_agente = ' . $idAgent . ' ORDER BY end_timestamp ASC'); -// -//$listPoints = array( -// array('id_tgis_data' => 0, 'longitude' => -3.709, 'latitude' => 40.422, 'altitude' => 0, 'manual_placemen' => 1), -// array('id_tgis_data' => 1, 'longitude' => -3.710, 'latitude' => 40.420, 'altitude' => 0, 'manual_placemen' => 0), -// array('id_tgis_data' => 2, 'longitude' => -3.711, 'latitude' => 40.420, 'altitude' => 0, 'manual_placemen' => 1), -// array('id_tgis_data' => 3, 'longitude' => -3.712, 'latitude' => 40.422, 'altitude' => 0, 'manual_placemen' => 0), -// array('id_tgis_data' => 4, 'longitude' => -3.708187, 'latitude' => 40.42056, 'altitude' => 0, 'manual_placemen' => 0) -//); - ?> \ No newline at end of file