2010-01-27 Miguel de Dios <miguel.dedios@artica.es>

* 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
This commit is contained in:
mdtrooper 2010-01-28 14:44:57 +00:00
parent 43f52ba036
commit 1242ab7368
4 changed files with 9 additions and 98 deletions

View File

@ -1,3 +1,10 @@
2010-01-27 Miguel de Dios <miguel.dedios@artica.es>
* 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 <pablo.concepcion@artica.es>
* include/functions_gis.php: Modiffied addPoint and addPointExtent to

View File

@ -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);

View File

@ -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) {

View File

@ -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)
//);
?>