Last active
December 7, 2021 14:09
-
-
Save antipole2/2c52e9bc0e63e2aed9acb87efd0b4ba4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add hyperlinks to an existing waypoint with markName of 'lunch stop' | |
wpName = "lunch stop"; | |
guids = OCPNgetWaypointGUIDs(); | |
foundIt = false; | |
for (i = 0; i < guids.length; i++){ | |
// look for our waypoint | |
lunchWaypoint = OCPNgetSingleWaypoint(guids[i]); | |
if (lunchWaypoint.markName == wpName){ | |
foundIt = true; | |
break; | |
} | |
} | |
if (!foundIt) throw("Waypoint not found"); | |
// we have our waypoint - now update it | |
lunchWaypoint.iconName = "Anchor"; | |
// nudge the position north towards shore | |
lunchWaypoint.position.latitude += 0.001; | |
lunchWaypoint.description = "Great anchorage with pub close ashore"; | |
lunchWaypoint.hyperlinkList.push({description:"Pub website", | |
link:"https://goldenanchor.co.uk"}); | |
lunchWaypoint.hyperlinkList.push({description:"Menu", | |
link:"https://goldenanchor.co.uk/menu"}); | |
OCPNupdateSingleWaypoint(lunchWaypoint); // update OpenCPN waypoint |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment