mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
Revert "Fixed agents display on GIS maps"
This reverts commit 6a53e924bb9f7170cfdc717ca3ee6360a8e6e5b9.
This commit is contained in:
parent
16cff75242
commit
2719cadc61
@ -446,12 +446,20 @@ function gis_add_agent_point($layerName, $pointName, $lat, $lon, $icon = null, $
|
||||
* Get the agents in layer but not by group in layer.
|
||||
*
|
||||
* @param integer $idLayer Layer ID.
|
||||
* @param array $fields Fields of row tagente to return.
|
||||
*
|
||||
* @return array The array rows of tagente of agents in the layer.
|
||||
*/
|
||||
function gis_get_agents_layer($idLayer) {
|
||||
function gis_get_agents_layer($idLayer, $fields = null) {
|
||||
|
||||
$sql = "SELECT id_agente, nombre
|
||||
if ($fields === null) {
|
||||
$select = '*';
|
||||
}
|
||||
else {
|
||||
$select = implode(',',$fields);
|
||||
}
|
||||
|
||||
$sql = "SELECT $select
|
||||
FROM tagente
|
||||
WHERE id_agente IN (
|
||||
SELECT tagente_id_agente
|
||||
@ -459,14 +467,16 @@ function gis_get_agents_layer($idLayer) {
|
||||
WHERE tgis_map_layer_id_tmap_layer = $idLayer)";
|
||||
$agents = db_get_all_rows_sql($sql);
|
||||
|
||||
$returned_agents = array();
|
||||
if ($agents !== false) {
|
||||
foreach ($agents as $index => $agent) {
|
||||
$returned_agents[$agent['id_agente']] = $agent['nombre'];
|
||||
$agents[$index] = $agent['nombre'];
|
||||
}
|
||||
}
|
||||
else {
|
||||
return array();
|
||||
}
|
||||
|
||||
return $returned_agents;
|
||||
return $agents;
|
||||
}
|
||||
|
||||
function gis_add_point_path($layerName, $lat, $lon, $color, $manual = 1, $id) {
|
||||
|
@ -146,7 +146,10 @@ if ($layers != false) {
|
||||
$agentNamesByGroup = agents_get_group_agents($layer['tgrupo_id_grupo'],
|
||||
false, 'none', true, true, false);
|
||||
}
|
||||
$agentNamesByLayer = gis_get_agents_layer($layer['id_tmap_layer']);
|
||||
$agentNamesByLayer = gis_get_agents_layer($layer['id_tmap_layer'],
|
||||
array('nombre'));
|
||||
|
||||
|
||||
|
||||
$agentNames = array_unique($agentNamesByGroup + $agentNamesByLayer);
|
||||
|
||||
@ -165,6 +168,7 @@ if ($layers != false) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$icon = gis_get_agent_icon_map($idAgent, true);
|
||||
$icon_size = getimagesize($icon);
|
||||
$icon_width = $icon_size[0];
|
||||
|
@ -182,7 +182,10 @@ if ($layers != false) {
|
||||
$agentNamesByGroup = agents_get_group_agents($layer['tgrupo_id_grupo'],
|
||||
false, 'none', true, true, false);
|
||||
}
|
||||
$agentNamesByLayer = gis_get_agents_layer($layer['id_tmap_layer']);
|
||||
$agentNamesByLayer = gis_get_agents_layer($layer['id_tmap_layer'],
|
||||
array('nombre'));
|
||||
|
||||
|
||||
|
||||
$agentNames = array_unique($agentNamesByGroup + $agentNamesByLayer);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user