سؤال

I've built a web application that runs on Google Maps API v3 and integrates the Google Earth API/Plugin to show my map in both 2D and 3D. As Google Maps API v3 doesn't have built-in support for the Google Earth Plugin, I'm using this library.

That library is working great, except that when I initialize my 2D and 3D maps, if the Google Earth plugin is not installed, I get a message like this across my entire map window, and I can't even use the 2D map:

Problem

Is there a way to disable this message or to hide it underneath my 2D map type? If not, is there some way to detect whether the Google Earth plugin is installed before loading and initializing the 3D library?

هل كانت مفيدة؟

المحلول

The library has been fixed to not get stuck in the earth view when the plugin can't be loaded. You will be able to get the plugin load state from the "initialized" event.

نصائح أخرى

You can use the following to detect if the Earth javascript is loaded and if the Earth plugin is installed before your code initializes the Earth map type:

 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';
  }
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top