Posted by tomhung on July 22, 2008 at 7:30pm
I just found this.... Thought you might be interested...
http://code.google.com/apis/earth/
The Google Earth Plug-in and its JavaScript API let you embed Google Earth, a true 3D digital globe, into your web pages. Using the API you can draw markers and lines, drape images over the terrain, add 3D models, or load KML files, allowing you to build sophisticated 3D map applications. If you have an existing Maps API site, you can 3D-enable your page with as little as one line of code.

Comments
add google earth to gmap
gmap.module
line:28
from
define('GMAP_API_VERSION', '2.115');to
define('GMAP_API_VERSION', '2');line:187
add
$map['Google']['Earth'] = array('title' => t('Google Earth Plugin'),
'default' => FALSE,
'help' => t('Map with Google Earth Plugin (http://code.google.com/apis/earth/) Internal name: G_PHYSICAL_3D_MAP'),
);
gmap.js
line:205
add
if (obj.vars.baselayers['Earth']) {opts.mapTypes.push(G_SATELLITE_3D_MAP);
opts.mapTypeNames.push('Earth');
}
you will now have a option on gmap to enable the "Earth" view. This will require the plugin or activeX control.
I hope this helps..
G
Thanks Tomhung. Anyone manage
Thanks Tomhung. Anyone manage to get a kml/kmz loaded onot the Google Earth Layer. Any help will be appreciated. Thanks.
When I do this, the location markers dont trnslate to GE
Thanks for this snippet btw!
When I choose to show user locations, the markers briefly show up as expected while the window is loading, and then as soon as the earth is visible the markers turn to little x's. is there a way to set the marker type as in the other map styles in a way that translates int GE?
Additionally when I add a node with a location and then choose to show node locations the same thing happens.
Any advice on how to have the marker style settings carry over would be appreciated, or even just to force a marker style other than the x would be gratly appreciated.
Thanks!
-biz
Two JS errors
I'm getting two JS errors when I try this:
1) Error calling method on NPObject (line 185)
2) this.pd is undefined (lines 793 & 804)
Does anyone have any idea how to fix this?
Error only occurs in Firefox
I just noticed that the errors I mentioned only occur in Firefox, not in IE. This is a rare time, I guess, when IE is better.
I'm able to get this working
I'm able to get this working in Chrome and IE, but not Firefox when setting Google Earth as the default map type.
In Firefox 3, the applet lags and does not load if set to default. BUT if the buttons are clicked back and forth a few times (Hybrid, Satellite, etc.), the GE applet re-appears.
updated the api version
to 2.153 and now have no problems in FF3
from
define('GMAP_API_VERSION', '2.115');to
define('GMAP_API_VERSION', '2.153');Sounds good
Ok, I'll try that.
Line numbers shifted.
I just applied this welcome hack and noticed the the line numbers to do the insertion of the new code have changed.
I am using version = "6.x-1.1-rc1" of GMap as of March 10, 2009.
in gmap.module the line to add the code snippet:
Would appear to be around 250. I put mine at the end of a Baselayers Case construct:
In gmap.js the line number to insert the snippet is around 242.
I added the GE layer to the Load Map types construct at the end, like so:
Have applied the new code there and am about to commence testing.
Now, has anyone tried
Now, has anyone tried loading a kmz / dae? According to the Google samples, it can be done with the new API.
loading KMZ/DAE
I have a Google Earth pane running in a Content type.
My understanding, to start with is that you can pass a KML file which could include a DAE in the Google Maps macro.
Have not had time to run that test yet, but that would be the simple way to start.
First thing I notice is that the GE Map is not solid in the web page when you scroll-- there is a lag that you don't get with a Google Map. I'd like to see that go away if possible, so that the user perception that the Google Earth view is firmly fixed in the page is maintained.
After getting the KML into the view through the Google Maps Macro and seeing it run, then there needs to be work done to drive the GE UI API through javascript, which is where things get cool.
L
If you happen to load a KML
If you happen to load a KML successfully, please post a little more about the process. I get an automap0 popup error when attempting to do it using the KML_Overlay plugin method (Gmap addon).
KMZ DAE using gmap & google earth plugin
just following up; anyone attempt this?
I'll try test it with kml
Thanks for share this, it's work great.
Anyone manage the KMl/KMZ
Anyone manage the KMl/KMZ insert into the Earth Layer. Please help??
yeah but i'm not using any
yeah but i'm not using any specific module.... for it...
but API code for Google Earth to import KML/KMZ files looks something like this...
var url = 'the_full_http_url_to_your_KML_or_KMZ_file';
google.earth.fetchKml(ge, url, finished);
document.getElementById('installed-plugin-version').innerHTML =
ge.getPluginVersion().toString();
Hope it helps
How To ?
Hi,
I'm knew to Drupal and though I read and browse a lot of module page, forum threads and tutorial I can find a "proper" mean to integrate inside Drupal a Google Earth Mashup.
To do so I've only be able to use
<
iframe> inside a page (see it at: http://www.atlas-solaire.fr/GHI-Map)
I would like to know if there is a step by step how to who allow me to do the same without relying on
<
iframe>.
Is there any live example of Drupal 6 Web site with Google Earth Mashups ?
Thanks for your help.
Cheers,
Lionel