Jump to content

Gsak And Google Earth Macro


Recommended Posts

Posted (edited)

I assume you're using the one from the GSAK macros page or released with recent GSAK versions?

 

I'm not sure how you could only output the currently-selected cache. The below modified version will allow you to only output user-flagged caches, though. If you're not familiar with the term "user flag", see the User Flag section of this helpfile page.

# *************************************************
# Macro to show your current filter in Google Earth
#**************************************************

# set up absolute paths to required files
$KMLFile=$_Install + "\temp\GSAK.KML"
$GPXFile=$_Install + "\temp\babel.gpx"
$Babel = $_Install + "\gpsbabel.exe"

# Filter for user flags
MFILTER IF=$d_UserFlag

# Make sure there's at least one user-flagged record
IF $_FilterCount = 0
CANCEL Msg="No records flagged!"
ENDIF

# set up $custom export
$Custom = $custom + "edtBabelOut.Text=" + quote($Babel) + " -N -i gpx -f " + quote($GPXfile) + " -o kml -F " + quote($KMLFile)
MACROSET Dialog=Custom VarName=$Custom

# Export to KML
EXPORT Type=CUS Settings=<macro>

# Open the file in Google Earth
OpenFile File=$KMLFile

# cancel the MFILTER
CANCELFILTER

<data> VarName=$Custom
[TfmBabel2]
edtProblem.Text=
edtFormat.Text=%name
edtMaxGps.Text=100
edtWaypoint.Text=%name %typ %con (%dif/%ter)
chkDebug.Checked=False
<enddata>

 

Edit: added helpfile link

Edited by Pasha
Posted
How can I change the GSAK's GoogleEarth.txt-Macro to see not all the caches filtered by GSAK but only the cache highlighted by the cursor in GSAK?

 

Assuming you have the GoogleEarth.txt macro in the Macros folder of the Install folder of GSAK (but it would be easy to alter it to work from any folder) then this macro will do it automatically for you.

 

Then all you have to do is add as a tool button and it is only one mouse click away.

 

$GEMacro=$_Install + "\Macros\GoogleEarth.txt"
MacroFlag Type=Clear Range=All
MacroFlag Type=Set Range=1
Mfilter if=$d_MacroFlag
Macro File=$GEMacro
CancelFilter

Posted
Could not this be done simpler with a right click on the waypoint and use the "custom URL"??

Not for GE because it is a program and it needs a file passed to it.

 

However, you can do this for the online service provided by Google because all it requires is a URL. You just need to add the following custom URLs

 

Google Maps=http://maps.google.com/maps?q=%lat+%lon+(%code-%ShortName=30)&hl=en

Google Satellite View=http://maps.google.com/maps?q=%lat+%lon+(%code-%ShortName=30)&spn=0.020,0.020&t=k

Posted (edited)

This is probably not the right place to post this, but since I'm running into the problem while editing the GE macro, here it is! I'm not able to successfully use special tags in the macro (I want to put %last4 in the description bubble). I'm using:

 

$cacheName = $d_Name

$placedBy = $d_PlacedBy

$diff = $d_Difficulty

$terrain = $d_Terrain

GetSpecial Data=%last4

$last4 = $result

GetSpecial Data=%drop2

$drop2 = $result

 

But I get an error on the $last4 = $result line (Invalid expression in macro). What's the right way to get that data?

 

Thanks! Love the macro, I have it doing great things! <_<

Edited by ahimsa
Posted
This is probably not the right place to post this, but since I'm running into the problem while editing the GE macro, here it is! I'm not able to successfully use special tags in the macro (I want to put %last4 in the description bubble). I'm using:

 

$cacheName = $d_Name

$placedBy = $d_PlacedBy

$diff = $d_Difficulty

$terrain = $d_Terrain

GetSpecial Data=%last4

$last4 = $result

GetSpecial Data=%drop2

$drop2 = $result

 

But I get an error on the $last4 = $result line (Invalid expression in macro). What's the right way to get that data?

 

Thanks! Love the macro, I have it doing great things! <_<

Bummer, you have actually found a small bug with the GetSpecial command.

 

The problem is that $Result is not being correctly returned as a string in double quotes (it is missing the double quotes).

 

The work around for the moment is to just surround $result with double quotes when you do the assignment:

 

GetSpecial Data=%last4
$last4     = "$result"
GetSpecial Data=%drop2
$drop2     = "$result"

Posted
The work around for the moment is to just surround $result with double quotes when you do the assignment:

 

GetSpecial Data=%last4
$last4     = "$result"
GetSpecial Data=%drop2
$drop2     = "$result"

That works great! Thanks!! Wow, this macro is much easier than the way I was doing it before! <_< I've changed it slightly so that the waypoint labels only show up when you mouse over them and added more info to the popup bubble!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...