次のコードは機能します。ページを読み込んで、地球を表示させることができます。
ナビゲーションコントロールを表示したい。initCBの行のコメントを外すと、機能します。
コードにはスコープの問題があり、それを機能させるには微調整が必要だと思います。
ありがとうございました。
declare var google;
class GoogleEarth {
static pluginInstance;
static display() {
google.load("earth", "1");
google.setOnLoadCallback(init);
}
static ShowNavigation() {
this.pluginInstance.getNavigationControl().setVisibility(this.pluginInstance.VISIBILITY_AUTO);
}
private static init() {
google.earth.createInstance('map3d', initCB, failureCB);
}
private static initCB(instance) {
this.pluginInstance = instance;
this.pluginInstance.getWindow().setVisibility(true);
//this.pluginInstance.getNavigationControl().setVisibility(this.pluginInstance.VISIBILITY_AUTO);
}
private static failureCB(errorCode) {}
}
GoogleEarth.display();
GoogleEarth.ShowNavigation();