2010-02-25 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_gis.php: use zoom level. * godmode/gis_maps/configure_gis_map.php: include the things about default zoom level in function "validateMapData", "getMapData" and add the function "getNumZoomLevelsOfConnectionDefault". git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2430 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
d3bce7aca6
commit
07a2cd2dc0
|
@ -1,3 +1,11 @@
|
|||
2010-02-25 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_gis.php: use zoom level.
|
||||
|
||||
* godmode/gis_maps/configure_gis_map.php: include the things about
|
||||
default zoom level in function "validateMapData", "getMapData" and add
|
||||
the function "getNumZoomLevelsOfConnectionDefault".
|
||||
|
||||
2010-02-25 Sancho Lerena <slerena@artica.es>
|
||||
|
||||
* godmode/alerts/configure_alert_template.php,
|
||||
|
|
|
@ -98,6 +98,7 @@ switch ($action) {
|
|||
$map_default_latitude = get_parameter('map_default_latitude');
|
||||
$map_default_altitude = get_parameter('map_default_altitude');
|
||||
$map_group_id = get_parameter('map_group_id');
|
||||
$map_levels_zoom = get_parameter('map_levels_zoom');
|
||||
|
||||
$map_connection_list_temp = explode(",",get_parameter('map_connection_list'));
|
||||
foreach ($map_connection_list_temp as $index => $value) {
|
||||
|
@ -133,7 +134,7 @@ switch ($action) {
|
|||
$invalidFields = validateMapData($map_name, $map_zoom_level,
|
||||
$map_initial_longitude, $map_initial_latitude, $map_initial_altitude,
|
||||
$map_default_longitude, $map_default_latitude, $map_default_altitude,
|
||||
$map_connection_list);
|
||||
$map_connection_list, $map_levels_zoom);
|
||||
|
||||
if (empty($invalidFields)) {
|
||||
saveMap($map_name, $map_initial_longitude, $map_initial_latitude,
|
||||
|
@ -167,6 +168,7 @@ switch ($action) {
|
|||
$map_group_id = '';
|
||||
$map_connection_list = Array();
|
||||
$layer_list = Array();
|
||||
$map_levels_zoom = 0;
|
||||
break;
|
||||
case 'edit_map':
|
||||
$idMap = get_parameter('map_id');
|
||||
|
@ -188,6 +190,9 @@ switch ($action) {
|
|||
$map_default_altitude = $mapData['map']['default_altitude'];
|
||||
|
||||
$map_connection_list = $mapData['connections'];
|
||||
$map_levels_zoom = getNumZoomLevelsOfConnectionDefault($map_connection_list);
|
||||
|
||||
//$map_levels_zoom = get_parameter('map_levels_zoom');
|
||||
|
||||
$layer_list = array();
|
||||
foreach ($mapData['layers'] as $layer) {
|
||||
|
@ -216,6 +221,7 @@ switch ($action) {
|
|||
$map_default_latitude = get_parameter('map_default_latitude');
|
||||
$map_default_altitude = get_parameter('map_default_altitude');
|
||||
$map_group_id = get_parameter('map_group_id');
|
||||
$map_levels_zoom = get_parameter('map_levels_zoom');
|
||||
|
||||
$map_connection_list_temp = explode(",",get_parameter('map_connection_list'));
|
||||
foreach ($map_connection_list_temp as $index => $value) {
|
||||
|
@ -251,7 +257,7 @@ switch ($action) {
|
|||
$invalidFields = validateMapData($map_name, $map_zoom_level,
|
||||
$map_initial_longitude, $map_initial_latitude, $map_initial_altitude,
|
||||
$map_default_longitude, $map_default_latitude, $map_default_altitude,
|
||||
$map_connection_list);
|
||||
$map_connection_list, $map_levels_zoom);
|
||||
|
||||
if (empty($invalidFields)) {
|
||||
//TODO
|
||||
|
@ -314,7 +320,7 @@ $table->data[1][0] = __('Group') . print_help_tip (__('Group that owns the map')
|
|||
$table->data[1][1] = print_select_from_sql('SELECT id_grupo, nombre FROM tgrupo', 'map_group_id', $map_group_id, '', '', '0', true);
|
||||
|
||||
$table->data[2][0] = __('Default zoom') . print_help_tip (__('Default zoom level when opening the map'), true). ':';
|
||||
$table->data[2][1] = print_input_text ('map_zoom_level', $map_zoom_level, '', 2, 4, true);
|
||||
$table->data[2][1] = print_input_text ('map_zoom_level', $map_zoom_level, '', 2, 4, true) . print_input_hidden('map_levels_zoom', $map_levels_zoom, true);
|
||||
|
||||
$table->data[3][0] = __('Center Longitude') . ':';
|
||||
$table->data[3][1] = print_input_text ('map_initial_longitude', $map_initial_longitude, '', 4, 8, true);
|
||||
|
@ -755,12 +761,14 @@ function setFieldsRequestAjax(id_conexion) {
|
|||
timeout: 10000,
|
||||
success: function (data) {
|
||||
if (data.correct) {
|
||||
console.log(data.content);
|
||||
$("input[name=map_initial_longitude]").val(data.content.initial_longitude);
|
||||
$("input[name=map_initial_latitude]").val(data.content.initial_latitude);
|
||||
$("input[name=map_initial_altitude]").val(data.content.initial_altitude);
|
||||
$("input[name=map_default_longitude]").val(data.content.default_longitude);
|
||||
$("input[name=map_default_latitude]").val(data.content.default_latitude);
|
||||
$("input[name=map_default_altitude]").val(data.content.default_altitude);
|
||||
$("input[name=map_zoom_level]").val(data.content.default_zoom_level);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -884,7 +884,7 @@ function getArrayListIcons($fullpath = true) {
|
|||
function validateMapData($map_name, $map_zoom_level,
|
||||
$map_initial_longitude, $map_initial_latitude, $map_initial_altitude,
|
||||
$map_default_longitude, $map_default_latitude, $map_default_altitude,
|
||||
$map_connection_list) {
|
||||
$map_connection_list, $map_levels_zoom) {
|
||||
$invalidFields = array();
|
||||
|
||||
echo "<style type='text/css'>";
|
||||
|
@ -896,7 +896,7 @@ function validateMapData($map_name, $map_zoom_level,
|
|||
}
|
||||
|
||||
//validate zoom level
|
||||
if ($map_zoom_level == '') {
|
||||
if (($map_zoom_level == '') || ($map_zoom_level > $map_levels_zoom)) {
|
||||
echo "input[name=map_zoom_level] {background: #FF5050;}";
|
||||
$invalidFields['map_zoom_level'] = true;
|
||||
}
|
||||
|
@ -958,9 +958,11 @@ function getMapData($idMap) {
|
|||
$returnVar = array();
|
||||
|
||||
$map = get_db_row('tgis_map', 'id_tgis_map', $idMap);
|
||||
$connections = get_db_all_rows_sql('SELECT tgis_map_connection_id_tmap_connection AS id_conection,
|
||||
default_map_connection AS `default`
|
||||
FROM tgis_map_has_tgis_map_connection WHERE tgis_map_id_tgis_map = '. $map['id_tgis_map']);
|
||||
$connections = get_db_all_rows_sql('SELECT t1.tgis_map_connection_id_tmap_connection AS id_conection,
|
||||
t1.default_map_connection AS `default`,
|
||||
(SELECT t2.num_zoom_levels
|
||||
FROM tgis_map_connection AS t2 WHERE t2.id_tmap_connection = t1.tgis_map_connection_id_tmap_connection) AS num_zoom_levels
|
||||
FROM tgis_map_has_tgis_map_connection AS t1 WHERE t1.tgis_map_id_tgis_map = '. $map['id_tgis_map']);
|
||||
$layers = get_db_all_rows_sql('SELECT id_tmap_layer, layer_name, tgrupo_id_grupo AS layer_group, view_layer AS layer_visible FROM tgis_map_layer WHERE tgis_map_id_tgis_map = ' . $map['id_tgis_map']);
|
||||
if ($layers === false) $layers = array();
|
||||
|
||||
|
@ -1019,6 +1021,21 @@ function addConectionMapsInForm($map_connection_list) {
|
|||
return $returnVar;
|
||||
}
|
||||
|
||||
/**
|
||||
* From a list of connection maps, extract the num levels zooom
|
||||
*
|
||||
* @param array $map_connection_list The list of connections maps.
|
||||
*
|
||||
* @return integer The num zoom levels.
|
||||
*/
|
||||
function getNumZoomLevelsOfConnectionDefault($map_connection_list) {
|
||||
foreach ($map_connection_list as $connection) {
|
||||
if ($connection['default']) {
|
||||
return $connection['num_zoom_levels'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function use in form the "pandora_console/godmode/gis_maps/configure_gis_map.php"
|
||||
* in the case of edit a map or when there are any error in save new map. Because this function
|
||||
|
|
Loading…
Reference in New Issue