Google Earth (contextual menu launch)

steve harley steve at paper-ape.com
Thu Apr 5 16:40:37 PDT 2007


they whom i call myself wrote:
> they whom i call Kevin Callahan wrote:
>> Anybody know if there's a contextual menu plugin that allows one to 
>> select an address in any text document and launch that address in 
>> Google Earth?
> 
> On My Command has an example that queries Google Maps for Madrid, Spain; 
> it shouldn't be too hard to modify this, or build your own contextual menu:

despite the fact i'm taking a GIS class, Kevin nudged me that i 
had once again scrambled Google's mapping tools in my brain -- he 
wanted Google Earth, not Google Maps; to get an address geocoded 
into Google Earth i think you'll need to create a kml file; so 
i'd suggest using On My Command to:

1) pass the selected address text to a script (in the language of 
your choice); the script will then:

2) splice the address into simple kml template

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.0">
<Placemark>
   <name>name here if you want</name>
   <visibility>1</visibility>
   <address>address goes here</address>
</Placemark>
</kml>

3) save the kml text into a temp file with extension .kml

4) open the .kml file, which should launch Google Earth, geocode 
the address (if it's well-formed), and create an item in the 
Places pane

5) not sure how to automatically fly the display to the new place 
  (can be done with AppleScript if you  know latitude & 
longitude), but the user can simply double-click the new place





More information about the MacOSX-talk mailing list