Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/vim/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Google Earth插件在jquery ui对话框(1.10.2)中出现内部错误_Javascript_Jquery_Jquery Ui_Google Earth_Google Earth Plugin - Fatal编程技术网

Javascript Google Earth插件在jquery ui对话框(1.10.2)中出现内部错误

Javascript Google Earth插件在jquery ui对话框(1.10.2)中出现内部错误,javascript,jquery,jquery-ui,google-earth,google-earth-plugin,Javascript,Jquery,Jquery Ui,Google Earth,Google Earth Plugin,我正在jquery ui对话框中弹出google earth插件。这在jquery ui 1.9.2上运行,但在升级到1.10.2后,插件加载,但在尝试移动对话框时,google earth停止使用“google earth插件出现内部错误。请尝试重新加载页面。” 这在Win7和OSX 10.8.2上都会发生,在Chrome和Safari上都会发生。 还有其他人遇到这个问题吗?变通办法 下面是下面代码的示例,如果您将jquery ui降级为1.9.2,则一切正常: <!DOCTYPE HT

我正在jquery ui对话框中弹出google earth插件。这在jquery ui 1.9.2上运行,但在升级到1.10.2后,插件加载,但在尝试移动对话框时,google earth停止使用“google earth插件出现内部错误。请尝试重新加载页面。”

这在Win7和OSX 10.8.2上都会发生,在Chrome和Safari上都会发生。 还有其他人遇到这个问题吗?变通办法

下面是下面代码的示例,如果您将jquery ui降级为1.9.2,则一切正常:

<!DOCTYPE HTML>
<html>
    <script type="text/javascript" src="//www.google.com/jsapi"></script>

    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

    <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js"></script>
    <link type="text/css" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/themes/smoothness/jquery-ui.css" rel="stylesheet" />
<script>

var loaded = false;

function loadGE() {
    google.load('earth', '1', {
        callback: function () {
            google.earth.createInstance('editmap3d', function (instance) {
                initEditGE(instance);
            }, function () {
                failureGE();
            });
        }
    });
}

function initEditGE(instance) {
    loaded = true;
    ge = instance;

    var lookAt = ge.createLookAt('');
    lookAt.setLatitude(36.584207);
    lookAt.setLongitude(-121.754322);
    lookAt.setRange(5000.0); //default is 0.0

    ge.getView().setAbstractView(lookAt);
    ge.getWindow().setVisibility(true);
    ge.getNavigationControl().setVisibility(ge.VISIBILITY_SHOW);
}

function failureGE() {
    console.log("GE failed to load...");
}


$(document).ready(function () {
    $("#opendialog").button().click(function () {
        $("#editDialog").dialog("open");

        if (!loaded) loadGE();
    });

    $("#editDialog").dialog({
        autoOpen: false,
        height: 500,
        width: 500,
        modal: true,
        resizable: false
    });
})


</script>

<body>
    <div>GE in popup</div>
    <button id="opendialog">open</button>
    <div id="editDialog">
        <div id="mapcontainer" style="width:600; height:600;">
            <div id="editmap3d" style="height:100%;"></div>
        </div>

    </div>
</body>
</html>

var-load=false;
函数loadGE(){
google.load('earth','1','{
回调:函数(){
google.earth.createInstance('editmap3d',函数(实例){
初始化(实例);
},函数(){
失败();
});
}
});
}
函数initedidge(实例){
加载=真;
ge=实例;
var lookAt=ge.createLookAt(“”);
环顾西纬度(36.584207);
注视经度(-121.754322);
lookAt.setRange(5000.0);//默认值为0.0
ge.getView().setAbstractView(lookAt);
ge.getWindow().setVisibility(true);
ge.getNavigationControl().setVisibility(ge.VISIBILITY\u SHOW);
}
功能失效{
日志(“GE未能加载…”);
}
$(文档).ready(函数(){
$(“#opendialog”)。按钮()。单击(函数(){
$(“编辑对话框”).dialog(“打开”);
如果(!loaded)loadGE();
});
$(“#编辑对话框”)。对话框({
自动打开:错误,
身高:500,
宽度:500,
莫代尔:是的,
可调整大小:false
});
})
通用电气弹出窗口
打开

我实际上观察到了与1.10.1类似的情况,即插件加载后崩溃。我所注意到的是,它在非精简版本中运行良好,但在1.10.1的精简版本中崩溃


编辑:我的问题不是jqueryui,而是jquery和googleearth。使用UI 1.10.3,它似乎可以与min和not min一起工作。

它似乎与MouseEvents有关。在OSX上,只要您尝试单击地图,它就会抛出错误,但您仍然可以通过API进行交互(添加/删除图层、平移/缩放等),而不会出现问题。在windows上,您可以与地图交互,但一旦您尝试移动对话框,就会出现错误。我正在做类似的事情,并遇到相同的问题。但是,它与jQueryUI1.10.1和Firefox20配合使用时不会出现问题。我没有尝试过其他配置/组合。好奇。。。