2013-05-20 Miguel de Dios <miguel.dedios@artica.es>
* operation/gis_maps/ajax.php, include/javascript/openlayers.pandora.js, include/functions_gis.php: lost changes to set the size of agent icons. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8168 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
b16fc05509
commit
f78b651a16
|
@ -1,3 +1,9 @@
|
||||||
|
2013-05-20 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* operation/gis_maps/ajax.php,
|
||||||
|
include/javascript/openlayers.pandora.js, include/functions_gis.php:
|
||||||
|
lost changes to set the size of agent icons.
|
||||||
|
|
||||||
2013-05-20 Miguel de Dios <miguel.dedios@artica.es>
|
2013-05-20 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
* pandoradb.data.postgreSQL.sql, pandoradb.data.oracle.sql,
|
* pandoradb.data.postgreSQL.sql, pandoradb.data.oracle.sql,
|
||||||
|
|
|
@ -251,7 +251,7 @@ function gis_activate_ajax_refresh($layers = null, $lastTimeOfData = null) {
|
||||||
var refreshAjaxIntervalSeconds = 60000;
|
var refreshAjaxIntervalSeconds = 60000;
|
||||||
var idIntervalAjax = null;
|
var idIntervalAjax = null;
|
||||||
var oldRefreshAjaxIntervalSeconds = 60000;
|
var oldRefreshAjaxIntervalSeconds = 60000;
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if ($layers === null) {
|
if ($layers === null) {
|
||||||
echo "var agentView = 1;";
|
echo "var agentView = 1;";
|
||||||
|
@ -260,20 +260,20 @@ function gis_activate_ajax_refresh($layers = null, $lastTimeOfData = null) {
|
||||||
echo "var agentView = 0;";
|
echo "var agentView = 0;";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
function refreshAjaxLayer(layer) {
|
function refreshAjaxLayer(layer) {
|
||||||
var featureIdArray = Array();
|
var featureIdArray = Array();
|
||||||
|
|
||||||
for (featureIndex = 0; featureIndex < layer.features.length; featureIndex++) {
|
for (featureIndex = 0; featureIndex < layer.features.length; featureIndex++) {
|
||||||
feature = layer.features[featureIndex];
|
feature = layer.features[featureIndex];
|
||||||
|
|
||||||
if (feature.data.type != 'point_path_info') {
|
if (feature.data.type != 'point_path_info') {
|
||||||
if (feature.geometry.CLASS_NAME == "OpenLayers.Geometry.Point") {
|
if (feature.geometry.CLASS_NAME == "OpenLayers.Geometry.Point") {
|
||||||
featureIdArray.push(feature.data.id);
|
featureIdArray.push(feature.data.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (featureIdArray.length > 0) {
|
if (featureIdArray.length > 0) {
|
||||||
jQuery.ajax ({
|
jQuery.ajax ({
|
||||||
data: "page=operation/gis_maps/ajax&opt=get_new_positions&id_features=" + featureIdArray.toString()
|
data: "page=operation/gis_maps/ajax&opt=get_new_positions&id_features=" + featureIdArray.toString()
|
||||||
|
@ -285,7 +285,7 @@ function gis_activate_ajax_refresh($layers = null, $lastTimeOfData = null) {
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
if (data.correct) {
|
if (data.correct) {
|
||||||
content = $.evalJSON(data.content);
|
content = $.evalJSON(data.content);
|
||||||
|
|
||||||
if (content != null) {
|
if (content != null) {
|
||||||
for (var idAgent in content) {
|
for (var idAgent in content) {
|
||||||
if (isInt(idAgent)) {
|
if (isInt(idAgent)) {
|
||||||
|
@ -296,11 +296,18 @@ function gis_activate_ajax_refresh($layers = null, $lastTimeOfData = null) {
|
||||||
delete feature;
|
delete feature;
|
||||||
feature = null
|
feature = null
|
||||||
status = parseInt(agentDataGIS['status']);
|
status = parseInt(agentDataGIS['status']);
|
||||||
|
|
||||||
js_addAgentPointExtent(layer.name, agentDataGIS['name'],
|
js_addAgentPointExtent(layer.name,
|
||||||
agentDataGIS['stored_longitude'], agentDataGIS['stored_latitude'],
|
agentDataGIS['name'],
|
||||||
agentDataGIS['icon_path'], 20, 20, idAgent, 'point_agent_info', status, agentDataGIS['id_parent']);
|
agentDataGIS['stored_longitude'],
|
||||||
|
agentDataGIS['stored_latitude'],
|
||||||
|
agentDataGIS['icon_path'],
|
||||||
|
agentDataGIS['icon_width'],
|
||||||
|
agentDataGIS['icon_height'],
|
||||||
|
idAgent,
|
||||||
|
'point_agent_info', status,
|
||||||
|
agentDataGIS['id_parent']);
|
||||||
|
|
||||||
//TODO: Optimize, search a new position to call for all agent in the layer and or optimice code into function.
|
//TODO: Optimize, search a new position to call for all agent in the layer and or optimice code into function.
|
||||||
js_refreshParentLines();
|
js_refreshParentLines();
|
||||||
}
|
}
|
||||||
|
@ -311,7 +318,7 @@ function gis_activate_ajax_refresh($layers = null, $lastTimeOfData = null) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function clock_ajax_refresh() {
|
function clock_ajax_refresh() {
|
||||||
//console.log(new Date().getHours() + ":" + new Date().getMinutes() + ":" + new Date().getSeconds());
|
//console.log(new Date().getHours() + ":" + new Date().getMinutes() + ":" + new Date().getSeconds());
|
||||||
for (layerIndex = 0; layerIndex < map.getNumLayers(); layerIndex++) {
|
for (layerIndex = 0; layerIndex < map.getNumLayers(); layerIndex++) {
|
||||||
|
@ -337,7 +344,7 @@ function gis_activate_ajax_refresh($layers = null, $lastTimeOfData = null) {
|
||||||
}
|
}
|
||||||
|
|
||||||
last_time_of_data = Math.round(new Date().getTime() / 1000); //Unixtimestamp
|
last_time_of_data = Math.round(new Date().getTime() / 1000); //Unixtimestamp
|
||||||
|
|
||||||
//Test if the user change the refresh time.
|
//Test if the user change the refresh time.
|
||||||
if (oldRefreshAjaxIntervalSeconds != refreshAjaxIntervalSeconds) {
|
if (oldRefreshAjaxIntervalSeconds != refreshAjaxIntervalSeconds) {
|
||||||
clearInterval(idIntervalAjax);
|
clearInterval(idIntervalAjax);
|
||||||
|
@ -345,7 +352,7 @@ function gis_activate_ajax_refresh($layers = null, $lastTimeOfData = null) {
|
||||||
oldRefreshAjaxIntervalSeconds = refreshAjaxIntervalSeconds;
|
oldRefreshAjaxIntervalSeconds = refreshAjaxIntervalSeconds;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready (
|
$(document).ready (
|
||||||
function () {
|
function () {
|
||||||
idIntervalAjax = setInterval("clock_ajax_refresh()", refreshAjaxIntervalSeconds);
|
idIntervalAjax = setInterval("clock_ajax_refresh()", refreshAjaxIntervalSeconds);
|
||||||
|
@ -357,7 +364,7 @@ function gis_activate_ajax_refresh($layers = null, $lastTimeOfData = null) {
|
||||||
|
|
||||||
function gis_add_agent_point($layerName, $pointName, $lat, $lon, $icon = null, $width = 20,
|
function gis_add_agent_point($layerName, $pointName, $lat, $lon, $icon = null, $width = 20,
|
||||||
$height = 20, $point_id = '', $status = -1, $type_string = '', $idParent = 0) {
|
$height = 20, $point_id = '', $status = -1, $type_string = '', $idParent = 0) {
|
||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
if (!$config['gis_label'])
|
if (!$config['gis_label'])
|
||||||
$pointName = '';
|
$pointName = '';
|
||||||
|
@ -610,7 +617,7 @@ function gis_save_map_connection($mapConnection_name, $mapConnection_group,
|
||||||
$mapConnection_defaultAltitude, $mapConnection_centerLatitude,
|
$mapConnection_defaultAltitude, $mapConnection_centerLatitude,
|
||||||
$mapConnection_centerLongitude, $mapConnection_centerAltitude,
|
$mapConnection_centerLongitude, $mapConnection_centerAltitude,
|
||||||
$mapConnectionData, $idConnectionMap = null) {
|
$mapConnectionData, $idConnectionMap = null) {
|
||||||
|
|
||||||
if ($idConnectionMap !== null) {
|
if ($idConnectionMap !== null) {
|
||||||
$returnQuery = db_process_sql_update('tgis_map_connection',
|
$returnQuery = db_process_sql_update('tgis_map_connection',
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -563,7 +563,7 @@ function js_addPoint(layerName, pointName, lon, lat, id, type_string, statusAgen
|
||||||
function js_addAgentPointExtent(layerName, pointName, lon, lat, icon, width, height, id, type_string, statusAgent, idParent) {
|
function js_addAgentPointExtent(layerName, pointName, lon, lat, icon, width, height, id, type_string, statusAgent, idParent) {
|
||||||
var point = new OpenLayers.Geometry.Point(lon, lat)
|
var point = new OpenLayers.Geometry.Point(lon, lat)
|
||||||
.transform(map.displayProjection, map.getProjectionObject());
|
.transform(map.displayProjection, map.getProjectionObject());
|
||||||
|
|
||||||
var layer = map.getLayersByName(layerName);
|
var layer = map.getLayersByName(layerName);
|
||||||
layer = layer[0];
|
layer = layer[0];
|
||||||
|
|
||||||
|
|
|
@ -119,8 +119,15 @@ switch ($opt) {
|
||||||
if (!$config['gis_label'])
|
if (!$config['gis_label'])
|
||||||
$row['nombre'] = '';
|
$row['nombre'] = '';
|
||||||
|
|
||||||
|
$icon = gis_get_agent_icon_map($row['tagente_id_agente'], true, $status);
|
||||||
|
$icon_size = getimagesize($icon);
|
||||||
|
$icon_width = $icon_size[0];
|
||||||
|
$icon_height = $icon_size[1];
|
||||||
|
|
||||||
$agents[$row['tagente_id_agente']] = array(
|
$agents[$row['tagente_id_agente']] = array(
|
||||||
'icon_path' => gis_get_agent_icon_map($row['tagente_id_agente'], true, $status),
|
'icon_path' => $icon,
|
||||||
|
'icon_width' => $icon_width,
|
||||||
|
'icon_height' => $icon_height,
|
||||||
'name' => $row['nombre'],
|
'name' => $row['nombre'],
|
||||||
'status' => $status,
|
'status' => $status,
|
||||||
'stored_longitude' => $row['stored_longitude'],
|
'stored_longitude' => $row['stored_longitude'],
|
||||||
|
|
Loading…
Reference in New Issue