Informative Maps 03 – External Links

Last month, I had a look at how to embed notes into your map, and make clickable links to show these. Such notes are great, since they are embedded into the map and thus part of the map file itself. But they also have their downsides, one of them being that they only support plain text. What if you want rich formatted text, maybe with some images?

Well, we can’t embed that into the map, but we can make the same kind of clickable hotspots that can link to either websites or external files. The notes are no longer part of the map, but they can easily be accessed from it.

I did cover the details for how to create the hotspots in last month’s article. If you need a refresher, I suggest having a look at that before continuing with today’s article.

Web Links

I assume you already have a website, designing one is a bit out of scope for this article. For my examples, I am just using https://www.profantasy.com as the url.

Creating the hotspot is done the exact same way as we did last month (Tools -> Macros -> Make Hotspot). The only difference is the macro command itself. You might remember that last time we used the command OPENNOTE, but this can’t show websites. Instead, we will be using the SHOWURL command. Just as with notes, we can make this a single-line command, like this:

SHOWURL https://profantasy.com;

Note that semicolon(;) at the very end. When you write a macro, you can EITHER place a semicolon at the end of the line OR hit enter to go to the next line (latter only works if multi-line is enabled.). You MUST have one of them, but you should NOT have both. Personally, I like writing single-line macros with a semicolon at the end like this, but if my macro is made up of multiple lines I prefer to just hit enter after each line instead (Don’t forget to hit enter after the last line).

If you forget the semicolon (or enter) the command will just go to the command line, but won’t run until you manually hit enter. You can try it for yourself, just make a hotspot without the semicolon, click it, and notice how the command line at the bottom changes to show your command, but it isn’t executed. Just hit enter, and it will run.

Of course, the fact that the semicolon has a special meaning in cc3+ also means you should avoid URLs with semicolons in them. This isn’t that common in URLs, but it is used to encode certain special characters, for example, the ampersand(&) is usually encoded as “&”. If you need to use such symbols in your URLs, I suggest using an URL shortening service, as they tend to give you a nice clean URL with only standard characters.

External Documents

Another place to keep information is in local files, for example a Word document or pdf files. You can make links that open these just as easy as maps notes or web links. The only thing you need to be aware of when using local files is how files are addressed. There are basically two main “ways” of addressing files, these are relative paths, which basically lets you specify the location of the file relative to the map or the current directory. These are great if you keep your related documents in the same folder as your map, and move them along with the map if you move it to a new folder. Then you have absolute paths. These tell exactly where on your hard drive the file is, but if you ever decide to move the file to another location, or put the map on another computer where the directory structure is slightly different, you will need to edit the path stored in the map. I therefore always recommend relative paths and just keeping the associated files in the same folder as the map.

So, for this little tutorial, we will assume that your file is called info.pdf, and that it is stored in the same folder as the map. If you want to read more about file paths, check out this article.

The command we need this time is OPENDOC. This command tells CC3+ that we want to open a local file. CC3+ will just tell Windows to go ahead and open that file, and it will be opened with the default program associated with that file type. CC3+ has no control over that.

So, to open our info.pdf (residing in the same folder as our map), we just need the command

OPENDOC $info.pdf;

Note that dollar-sign($) at the beginning of the file name. That is the way to tell CC3+ that the file is in the same folder as the map. If the file was in the CC3+ data directory instead, we would have written @file.pdf, but it makes more sense to keep it in the same folder as the map.

(What I wrote about the semicolon above applies equally here too).

Where to put the Hotspots?

These hotspots can be placed anywhere in your map. Some suggestions:

  • On the feature itself, for example on the building the information applies to, like we did with the map note in last months entry.
  • On a text entity, for example you can have a small list of links in a legend or similar. Just add the text first to the map as regular text, then create the hotspot and place it so it overlaps the text.
  • On a navigation bar made up from a set of icons, like a menu of sorts.

 

 

If you have questions regarding the content of this article, please use the ProFantasy forums. It can take a long time before comments on the blog gets noticed, especially for older articles. The forums on the other hand, I frequent daily.

Leave a Reply