craigsboyd
IS-IT--Management
Well, I could have sworn there was a thread out on these forums about automating Google Earth that I answered yesterday, but I can't for the life of me find it now. In any event, here is some VFP code that shows a couple things you can do with Google Earth...
First Example
Second Example
(make sure to save the screen shot - don't close Google Earth, as it will close by itself after the screen shot is saved)
SweetPotato Software Website
My Blog
First Example
Code:
*!* Let's go look at the Statue of Liberty
KH = CreateObject("Keyhole.KHInterface")
View = KH.currentView(0)
View.latitude = 40.6892
View.longitude = -74.0445
View.azimuth = 30
View.range = 100
View.tilt = 20
KH.setView(View, 10, .5)
Second Example
(make sure to save the screen shot - don't close Google Earth, as it will close by itself after the screen shot is saved)
Code:
LOCAL lcPictName
KH = CreateObject("Keyhole.KHInterface")
*!* There has to be a better way to wait for it to
*!* initialize, StreamingProgressPercentage was no help
=INKEY(4,"H") && wait for Google Earth to finish initializing
KH.setViewParams(40.7485, -73.9865, 250, 45, 30, 0, .5)
?KH.streamingProgressPercentage
lcPictName = PUTFILE("Save Image?", SYS(2015) + ".jpg")
IF !EMPTY(lcPictName)
KH.SaveScreenShot(lcPictName, 100)
MESSAGEBOX("A Screen Shot of the Empire State Building was saved to: " + CHR(13) ;
+ lcPictName, 64, "Saved Google Earth Image")
ENDIF
KH.QuitApplication()

SweetPotato Software Website
My Blog