2

I'm putting together an app that will show a news item's location in Google Earth using the javascript api. This is working great but we want to prevent users from manually dragging the globe around.

I know for Google Maps there is a function disableDragging which accomplishes this, but in the Earth api I could find no similar function.

I also tried placing a (nearly) transparent div over the GE container but any div with a non-solid background disappears over the container.

Fraser
  • 15,275
  • 8
  • 53
  • 104
Peter Duijnstee
  • 3,759
  • 2
  • 20
  • 30

1 Answers1

6

There is a standard method in the Api to disable mouse control of the globe.

// where ge is an instance of the plugin object 
ge.getOptions().setMouseNavigationEnabled(false);

Here is a working example.

I am not 100% sure what you mean with 'transparent div over the GE container' but perhaps the iframe shim technique is what you are looking for?

Fraser
  • 15,275
  • 8
  • 53
  • 104
  • Perfect, that's exactly what I was looking for! And yeah I ended up using the frame shims but this is much better. Thanks again! – Peter Duijnstee Feb 25 '11 at 16:02