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


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: 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 | # ]