我已经构建了一个运行在Google v3上的web应用程序,并集成了Google /Plugin来显示我的地图的2D和3D。由于Google v3不支持Google插件,所以我使用的是这个图书馆。
这个库运行得很好,只是当我初始化我的2D和3D地图时,如果没有安装Google Earth插件,我会在整个地图窗口收到这样的消息,我甚至不能使用2D地图:
是否有方法禁用此消息或将其隐藏在我的2D地图类型下?如果没有,是否有方法检测在加载和初始化3D库之前是否安装了Google插件?
发布于 2011-09-10 05:18:31
当插件无法加载时,该库已被修复,以避免卡在地球视图中。您将能够从“初始化”事件中获取插件加载状态。
发布于 2011-09-09 19:17:40
您可以使用以下方法来检测地球javascript是否已加载,以及在代码初始化地球地图类型之前是否安装了Earth插件:
if (!google || !google.earth) {
throw 'google.earth not loaded';
}
if (!google.earth.isSupported()) {
throw 'Google Earth API is not supported on this system';
}
if (!google.earth.isInstalled()) {
throw 'Google Earth API is not installed on this system';
}
https://stackoverflow.com/questions/7355218
复制相似问题