The GIS tooltip is now a modal view

This commit is contained in:
Alejandro Gallardo Escobar 2018-04-09 17:19:29 +02:00
parent 1dc8fec69a
commit 6ccf1ef27a
1 changed files with 33 additions and 43 deletions

View File

@ -196,34 +196,28 @@ function gis_make_layer($name, $visible = true, $dot = null, $idLayer = null, $p
layer.events.on({
"featureselected": function(e) {
if (e.feature.geometry.CLASS_NAME == "OpenLayers.Geometry.Point") {
var feature = e.feature;
var featureData = feature.data;
var long_lat = featureData.long_lat;
var popup;
var featureData = e.feature.data;
var img_src = null;
var img_src = "<?php echo ui_get_full_url('images/spinner.gif', false, false, false, false); ?>";
var $details = $('<div />');
jQuery.ajax ({
url: "<?php echo ui_get_full_url('ajax.php', false, false, false, false); ?>",
data: {
page: "include/ajax/skins.ajax",
get_image_path: 1,
img_src: "images/spinner.gif"
$details
.prop("id", 'cloudContent_' + featureData.id)
.css("text-align", "center")
.html('<img src="' + img_src + '" />')
.dialog({
title: "<?php echo __('Agent'); ?> #" + featureData.id,
resizable: true,
draggable: true,
modal: true,
overlay: {
opacity: 0.5,
background: "black"
},
type: 'GET',
dataType: 'html',
success: function (data) {
img_src = data;
popup = new OpenLayers.Popup.FramedCloud('cloud00',
long_lat,
null,
'<div class="cloudContent' + featureData.id + '" style="text-align: center;">' + img_src + '</div>',
null,
true,
function () { popup.destroy(); });
feature.popup = popup;
map.addPopup(popup);
close: function () {
$details.remove();
}
});
jQuery.ajax ({
url: "<?php echo ui_get_full_url('ajax.php', false, false, false, false); ?>",
@ -236,18 +230,14 @@ function gis_make_layer($name, $visible = true, $dot = null, $idLayer = null, $p
map_id: <?php echo (int)$id_map; ?>
},
type: "GET",
dataType: 'json',
dataType: "json",
success: function (data) {
if (data.correct) {
$('.cloudContent' + featureData.id).css('text-align', 'left');
$('.cloudContent' + featureData.id).html(data.content);
popup.updateSize();
$details.css("text-align", "left").html(data.content);
}
}
});
}
});
}
}
});
}