Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 05-10-2011, 04:36   #1
Registered User

Join Date: May 2011
Posts: 847
Cruising Guide with Additional Information Links

I have just had some time on my hands while at sea to work on some pilotage notes/cruising guides for the areas I sail in. I have been experimenting with adding links to the data from within the Waypoints additional information feature of OpenCPN by adding the links to the GPX files.

I have the information in browsable html files with information such as mud-maps and photos available as clickable links.

I can link to an image on the hard-drive easily, or to an html file. But to get this feature working nicely I need to be able to link to a location within an html document in the form of 'filename.html#location' which I can make work if the link is http:// xxxxx but it doesn't work if the link is file://.

Anybody know how to link to a named location in an html file on the local drive?

To make the guide 'interactive' it would be necessary to be able to click on a location within the cruising guide that would then open the location in OpenCPN. Is this possible within the current OpenCPN framework?

Chris
__________________

__________________
Littlechay is offline   Reply With Quote
Old 06-10-2011, 16:47   #2
Senior Cruiser
 
sinbad7's Avatar

Cruisers Forum Supporter

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,717
Images: 57
Send a message via Skype™ to sinbad7
Re: Cruising guide with additional information links

Chris..

Unless I am misunderstanding your requirements,it is easy to create links to both html files and other files,either located on your hard drive,or on a remote URL using the 'Additional information' feature of the Route Manager. In this way you can activate anything without leaving OCPN.

Have a look at an example below:

Quote:
<?xml version="1.0" encoding="utf-8" ?>
<gpx version="1.1" creator="OpenCPN" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.topografix.com/GPX/1/1" xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd" xmlnspencpn="http://www.opencpn.org">
<wpt lat="60.180173424" lon="5.107646781">
<time>2011-09-13T20:47:12Z</time>
<name>EXTRA INFO-B</name>
<link href="d:/Program files/OpenCPN/GPX/BERGEN-TRONDHEIM">
<text>BGO-TRD track</text>
</link>
<link href="http://www.2sandnessjo.no/shipplotter/gmap/oslo.html">
<text>AIS targets</text>
<link href="http://www.yachtmarine.com/SPOTMARINE/SPOTMAPINTERFACE.html">
<text>Current Globalstar SPOT position</text>
</link>
<link href="C:\Program Files\Zoner\Photo Studio 13\Program32\Zps.exe">
<text>Photo editor</text>
</link>
<link href="F:\PHOTO LOCATIONS\Mandal-Arendal\Screenshot_04 Sep. 04 11.34.jpg">
<text>Track Photos</text>
</link>
<sym>info</sym>
<type>WPT</type>
<extensions>
<opencpn:guid>3afb0000-a933-4d34-8ca0-779e7112ffff</opencpn:guid>
<opencpn:viz>1</opencpn:viz>
<opencpn:viz_name>1</opencpn:viz_name>
</extensions>
</wpt>
</gpx>
Tore
Attached Thumbnails
Click image for larger version

Name:	Screenshot_02 Oct. 06 19.49.jpg
Views:	81
Size:	24.9 KB
ID:	32423  
__________________

__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 06-10-2011, 20:00   #3
Registered User

Join Date: May 2011
Posts: 847
Re: Cruising guide with additional information links

Quote:
Originally Posted by sinbad7 View Post
Chris..

Unless I am misunderstanding your requirements
Yes it would appear there is a misunderstanding.

It is easy to link to files using the links as you described. But it should be possible to link to a named location in an html file using the link format 'filename.html#location'. This works for a location in a file served by a http server i.e. a link in the form of http://www.web.com/file.html#location but it doesn't work in the file:///filename.html#location format because there is no server to know where the location is.

This is my understanding anyway.

My cruising guide is in the format of a readable HTML file and not hundreds of seperate files for each location so I need to able to link to the specific location within a file.

I don't want to be running a server to do this as I want to be able to put the relavant files on a USB stick to pass to colleages etc..

Cheers
Chris
__________________
Littlechay is offline   Reply With Quote
Old 06-10-2011, 20:07   #4
Senior Cruiser
 
sinbad7's Avatar

Cruisers Forum Supporter

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,717
Images: 57
Send a message via Skype™ to sinbad7
Re: Cruising Guide with Additional Information Links

Chris..

Unless you are expecting to memorize hundreds of file locations,you will need some kind of a menu or perhaps a search field. Google can also be used to search local directories I believe.

Tore
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 06-10-2011, 20:15   #5
Registered User

Join Date: May 2011
Posts: 847
Re: Cruising Guide with Additional Information Links

Not with you here Tore... why would I need to memorise anything? for a cruising guide each location will have a waypoint.. click the additional information link in the waypoint for info on that location.... no need to memorise anything, that's the point.

My html files are menued and if I am reading the files in a browser it's no problem. But I need to link to specific location from within OpenCPN and if the links in GPX files are to be useful this is a necessity.

Forget Google.. this needs to be used at sea, no internet.. IMO people are trying to get OpenCPN too integrated with the internet which is not available to most people at sea when they are navigating.. side issue I'll shut up.

Chris
__________________
Littlechay is offline   Reply With Quote
Old 06-10-2011, 20:26   #6
Registered User

Join Date: Mar 2009
Location: Western Australia
Boat: Beneteau Oceanis 311
Posts: 133
Re: Cruising Guide with Additional Information Links

Instead of an absolute (complete) web address, just use a relative (partial) address that has a dot ("./ImageFolder/filename.html") in front of it. this This only works if the image is in a subfolder of a website, or in a hard-drive file subfolder under a folder containing the main html document.

Similarly you can create a link to named anchor (#location) in another named html file using the same technique so long as the target html is in the subfolder or even the same folder. ("./FileFolder/filename.htm#location" or "./filename.htm#location")
__________________
RigelKent is offline   Reply With Quote
Old 06-10-2011, 20:29   #7
Registered User

Join Date: May 2011
Posts: 847
Re: Cruising Guide with Additional Information Links

Quote:
Originally Posted by RigelKent View Post
Instead of an absolute (complete) web address, just use a relative (partial) address that has a dot ("./ImageFolder/filename.html") in front of it. this This only works if the image is in a subfolder of a website, or in a hard-drive file subfolder under a folder containing the main html document.

Similarly you can create a link to named anchor (#location) in another named html file using the same technique so long as the target html is in the subfolder or even the same folder. ("./FileFolder/filename.htm#location" or "./filename.htm#location")
I know the HTML, but named locations do not work for files on local disk, only files served from http server... at least between opencpn and the browsers I have tried.
__________________
Littlechay is offline   Reply With Quote
Old 07-10-2011, 04:54   #8
Senior Cruiser
 
sinbad7's Avatar

Cruisers Forum Supporter

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,717
Images: 57
Send a message via Skype™ to sinbad7
Re: Cruising Guide with Additional Information Links

Chris..

I just downloaded the Google Desktop search utility and find it incredibly useful and fast. Here there is no need of internet and you can search on just about anything.

Just do a double click on CTRL and the small search window appears. The search result is displayed before you have typed your query.

Perhaps this can at least partially solve your info problem at sea?

Tore
Attached Thumbnails
Click image for larger version

Name:	Screenshot_05 Oct. 07 07.41.jpg
Views:	83
Size:	269.8 KB
ID:	32435  
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 07-10-2011, 05:36   #9
Registered User

Join Date: May 2011
Posts: 847
Tore,

Hmmm I don't have an information problem. I have all my info organised as a local website or a local wiki. It works perfectly.

The problem I have is that the links to named locations within my HTML documents from OpenCPN don't work. For example I have a HTML page for south Georgia with each anchorage a clickable link from a table of contents. These links are the 'named' locations I am talking about. So the file name is something like 'navweb/sgnotes.html' then each anchorage or info chunk is a named location e.g. 'navweb/sgnotes.HTML#elsehul' . This location takes you to location in the doc with the info on Elsehul where I also have links to mud maps etc.

It all works great , except that the links to the named locations don't work from OpenCpn . Any link to a named location that I put in a waypoint's gpx file as additional info only links to the parent file, the link doesn't take you to the correct location within the file. For some reason the #Elsehul part is dropped, in the above example.

In summary the problem is not my information but that I can't access that information directly from OPenCPN.
__________________
Littlechay is offline   Reply With Quote
Old 07-10-2011, 06:21   #10
Registered User

Join Date: Mar 2009
Location: Western Australia
Boat: Beneteau Oceanis 311
Posts: 133
Re: Cruising Guide with Additional Information Links

Quote:
Originally Posted by Littlechay View Post
I know the HTML, but named locations do not work for files on local disk, only files served from http server... at least between opencpn and the browsers I have tried.
Can't say what HTML the OpenCPN supports. I've found I need to use the relative links to make browsers support jumps to a named location within another local (not web-served) html files. Good luck - another idea to try would be to use your own local system as a webserver and use the localhost://path as the web address of the file. You can configure a virtual folder in the local webserver that points to the file folder containing your local files. Hope this helps.
__________________
RigelKent is offline   Reply With Quote
Old 07-10-2011, 06:31   #11
Senior Cruiser
 
sinbad7's Avatar

Cruisers Forum Supporter

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,717
Images: 57
Send a message via Skype™ to sinbad7
Re: Cruising Guide with Additional Information Links

Littlechay..

In the example attached below,I am linking to a local .html page via the 'Additional information' utility in the OCPN Route Manager. Any subsequent selection from the menu must of course also be directed to a .htm file residing on your HD.

Please forgive me if I am still missing your point.

I would also strongly recommend all to download the Google Desktop search facility,it really is awesome.

Tore
Attached Thumbnails
Click image for larger version

Name:	Screenshot_06 Oct. 07 09.24.jpg
Views:	87
Size:	312.5 KB
ID:	32437  
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 07-10-2011, 07:08   #12
Registered User

Join Date: May 2011
Posts: 847
Re: Cruising Guide with Additional Information Links

Quote:
Originally Posted by sinbad7 View Post
Littlechay..

Please forgive me if I am still missing your point.

Tore
I can link to a file no problem.. I can't link to a named location within a file...

I'll try to make some screen shots illustrating the point later.

I have to disagree with you about the Google desktop search function.. I find it very invasive and almost viral.

Chris
__________________
Littlechay is offline   Reply With Quote
Old 07-10-2011, 07:32   #13
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,395
Re: Cruising Guide with Additional Information Links

so,my confusion is,are you saying Opencpn can't use the internal links when they DO exist or are you asking how to write the internal links?
Because in html,I think you would need to write them...SeaMonkey Browser is a great one for this.You can open and edit existing html page.

more again,
If I get you right,you want to do as they do online...
EXAMPLE:
When I open a page stored on my hdd,it looks like this:
file:///D:/DownloadedStuff/tabtrick.html
that page has it's own links that take you down the page(not to a different page) as in this:
file:///D:/DownloadedStuff/tabtrick.html#what
or:
file:///D:/DownloadedStuff/tabtrick.html#dupes

the #what and the #dupes are the thing...

using Firefox menu I find View/page/source and it looks like this...
a bunch of stuff ahead of it and after of course...
Code:
         <li><a href="tabtrick.html#how">How file name completion works</a></li>         <li><a href="tabtrick.html#dupes">Files starting with same letters</a></li>         <li><a href="tabtrick.html#what">What can be completed</a></li>         <li><a href="tabtrick.html#ref">What next?</a></li>
...
the user sees"What can be completed" not "what" and so on
Sorry I don't have a boaty example ...anyways it's an html coding question you are asking,I think .
Unless you know all this.sorry.
__________________
HappySeagull is offline   Reply With Quote
Old 07-10-2011, 07:43   #14
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,395
Re: Cruising Guide with Additional Information Links

an example from the page I happen to have and describe
per above..specifically the "what" mention.

This is what it looks like....

Click image for larger version

Name:	Clipboard01.jpg
Views:	70
Size:	11.9 KB
ID:	32438

takes you down the page to:

Click image for larger version

Name:	Clipboard02.jpg
Views:	73
Size:	42.3 KB
ID:	32439
__________________
HappySeagull is offline   Reply With Quote
Old 07-10-2011, 07:50   #15
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,395
Re: Cruising Guide with Additional Information Links

...so a long story short,
Chay,do the links exist already in the html code?They should.That'd be my take.
__________________

__________________
HappySeagull is offline   Reply With Quote
Reply

Tags
cruising, cruising guides

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cruising Guide to Long Island Sound and New England Helbent Atlantic & the Caribbean 5 06-09-2011 19:11
Recommendations on Western Caribbean Cruising Guides ? SoonToBe Atlantic & the Caribbean 10 30-08-2011 15:22
Cruising Guide to Aruba JARogers Cruising News & Events 1 29-06-2011 08:31
Aruba cruising guide testing! Tranquilo General Sailing Forum 0 25-06-2011 09:11



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 08:27.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.