我有一个出现在 OpenLayers 地图顶部的 jQuery 模式。当我尝试控制模态时,它会忽略模态并控制地图。我只能控制地图之外的区域。我该如何解决这个问题?
谢谢!
function init_editor() {
$( '#widthColor' ).colorPicker();
$( '#fillColor').colorPicker();
$( "#slider" ).slider({
value:1,
min: 1,
max: 5,
step: 1,
slide: function( event, ui ) {
$( "#amount" ).val( ui.value );
}
});
$( "#transparency" ).slider({
value: 0.5,
min: 0.1,
max: 1,
step: 0.1,
slide: function( event, ui ) {
$( "#trans_val" ).val( ui.value );
}
});
$( "#amount" ).val( $( "#slider" ).slider( "value" ) );
$( "#trans_val" ).val( $( "#transparency" ).slider( "value" ) );
//Map KML editor modal
var dlg = $( "#layer-manager" ).dialog({
modal: true,
width: 300,
height: 300,
autoOpen: false,
buttons: {
Ok: function( e ) {
e.preventDefault();
setColor( $('#widthColor').val(), $('#fillColor').val(), $('#amount').val(), $('#trans_val').val() );
$( this ).dialog( "close" );
}
}
});
//Register the modal
$(document).on("click", "a.layer-manager", function(e){
$( "#layer-manager").dialog( "open" );
});
}