Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

View Google Map and TerraServer image for one location Web Browsers
I saw a recent hint relating to Google Maps, and thought I'd submit my GPL GeoScript AppleScript. If you give a set of GPS coordinates (in decimal format) to GeoScript, it will open Firefox with windows for a Google Map and a TerraServer image at that location. I was inspired by a hint at hackaday.com that described the URLs to use for both websites. You can get GeoScript at pairofsachs.net (macosxhints mirror [31KB]).

The script opens Firefox for me, and creates the URLs from the coordinates. If you prefer to enter latitude first instead of longitude, editing the script shouldn't be too difficult. And now that Google maps supports Safari, you could also modify the script to run in Safari.

[robg adds: This script worked as described...]
    •    
  • Currently 2.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[12,624 views]  

View Google Map and TerraServer image for one location | 5 comments | Create New Account
Click here to return to the 'View Google Map and TerraServer image for one location' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
View Google Map and TerraServer image for one location
Authored by: Nafai23 on Mar 08, '05 11:54:47AM

This only opens one window for me, the Google maps one. Firefox 1.0.1



[ Reply to This | # ]
Addendum
Authored by: Nafai23 on Mar 08, '05 11:57:14AM

It works if Firefox isn't running, but if it's already running, I only get the Google Maps window.



[ Reply to This | # ]
View Google Map and TerraServer image for one location
Authored by: ether on Mar 08, '05 03:02:52PM

Here's the Safari version, which wasn't _completely_ obvious:

-- GeoScript, a quick coordinate to map lookup script

-- Copyright (C) 2005 Gregory Sachs

--This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

--This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

--You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

--Thanks to http://www.hackaday.com/entry/1234000263031072/ for the idea and info

-- Variables
set lon to "0.0"
set lat to "0.0"

set terra1 to "http://terraserver.microsoft.com/" & "image.aspx?PgSrh:NavLon="
set terra2 to "&PgSrh:NavLat="

set gmap1 to "http://maps.google.com/?sll="
set gmap2 to "%2C"

-- display dialog to get information
-- i don't think there is a way to
-- pull lon and lat from one dialog...
display dialog "Please enter Latitude (decimal)." buttons {"Cancel", "OK"} default button "OK" giving up after 500 with icon 1 default answer ""
set lat to text returned of the result

-- i might want to add a back button to change the lat?
-- or it might not be worth it. just restart the script
display dialog "Please enter Longitude (Latitude is " & lat & ")." buttons {"Cancel", "OK"} default button "OK" giving up after 210 with icon 1 default answer ""
set lon to text returned of the result

--finally, open the pages
tell application "Safari"
--this activate is necessary in case Safari
--isn't running. without it, Safari will open
--but only the gmap location will be displayed
activate
open location terra1 & lon & terra2 & lat
open location gmap1 & lat & gmap2 & lon
end tell



[ Reply to This | # ]
View Google Map and TerraServer image for one location
Authored by: jporten on Mar 08, '05 03:59:42PM
-- display dialog to get information
-- i don't think there is a way to
-- pull lon and lat from one dialog...


set latlongtext to text returned of ¬
   (display dialog "Please enter latitude, longitude (decimal)."¬
   buttons {"Cancel", "OK"} default button "OK" giving up after 500 with icon 1 default answer "")

set astid to AppleScript's text item delimiters
set AppleScript's text item delimiters to ","
set lat to the first text item of latlongtext as number
set long to the second text item of latlongtext as number
set AppleScript's text item delimiters to astid


[ Reply to This | # ]
View Google Map and TerraServer image for one location
Authored by: jporten on Mar 08, '05 04:03:23PM

grr. Of course, a typo. Replace my variable "long" with "lon" or this patch will break the script.



[ Reply to This | # ]