We have a custom map using Google Maps V3 to help visualize the information for our social media site, i.e. Blogs, Wikis, Forum geo spatial data.
Before the map is shown all the markers are dropped into arrays and then the setMap() method is called on each.
We have a gui interface that allows each set of markers to be individually turned on/off.
All this worked well but the next requirement is to integrate google earth api into the map.
I’ve seeen 2 methods to do this, which revolve around these loading methods:
1) var earth = new GoogleEarth(data.map);
2) google.earth.createInstance(‘map_canvas’, initCallback, failureCallback);
Method 1 works the best, all the markers are auto-loaded into google earth, complete with working info windows, etc. The problem – when the interface expands the map does not and when turning layers on/off google earth ignores it. You have to go back to map view and turn them off, then back into earth view to see the change.
Method 2 loads the map up, which expands to fit the map canvas nicely, but no points, no buttons to switch views, no navigation controls…no nothing.
I’m a bit confused, where should I go from here? Is there any way to get google earth plugin to interact just like my current V3 maps do without too much rewriting of existing code?
Best way is to use the Google Maps API Utility Library for Earth Integration:
http://google-maps-utility-library-v3.googlecode.com/svn/trunk/googleearth/