Google MyMaps is a very useful tool for people, who want to create their own map and base it on the Google Maps interface. Personally I use it quite often, especially when plan some journey or place some interesting objects across the World or some region. An important thing is to refer the stuff, prepared in our document to a particular location on the map and other way round. To link up some text or element in our document with the rough location on the map is not a difficult thing. On the contrary, making it in he reverse sequence may be sometimes quite tricky, especially when you don’t owe a basic software to help you with. However in this article I am going to show you roughly how it works from both sides. Let’s go then!
- LINK THE TEXT OR OBJECT TO THE MAP
In most of software used for writing, calculations or drawing issues you have an hyperlink option. It obviously enables you to link up the text or particular object to the desired destination. In our case this destination will be an interactive map created in Google MyMaps.
First of all we should know what elements does the Google MyMaps link includes. Basically there are 2 link sections, which should draw our attention if we want to set our location properly (Pic. 1). There are:
– coordinates section,
– zoom factor.
Apart from these there are another 3, which we should know only out of interests for our purpose (Pic.2): user page, map mode (viewer or editor) and map ID.
When you start to drag your map a bit, you will see in the link path with the coordinates section changes instantly. The coordinates value refers to the middle point of your map.
We can use this quite long URL to hyperlink some stuff in your document. For example in MS Excel (Pic. 3,4). We must choose the “Link” option and imput our URL address. Don’t worry if it’s longer than input frame. It will work.
Once you hyperlink your document to the particular location on your map, it will be open in default browser in the future (Pic.5).
Unfortunately the link doesn’t switch you to the object directly, so you must click on the placemark located in the middle, however in my point of view is a minor thing.
Using hyperlinks from documents to the Google MyMaps such this is a very convenient way to pop out on the proper location. Furthermore if your map is public, then everyone who is sharing your document can take a glimpse on the location, also in mobile version. This is for sure the easiest and the quickest way to hyperlink your work to the map, wherever the hyperlink option is available (MS Office, GIS software, AutoCAD, etc), also after saving the file in PDF version (Pic. 6).
2. LINK THE TEXT OR OBJECT TO THE .KML FILE
Unlike to Google MyMaps, linking our work to a particular .kml file, a default format for Google Earth software can be a bit tricky task. Firstly, the difference lies in the file location. When linking to Google MyMaps you don’t need the tool to open it, except the internet browser, installed by default. The .kml file must have a Google Earth to being open. Otherwise you won’t see the location, even when the hyperlink refers to some .kml file located on the server. However taking into account, that Google Earth is a free software and widely common I can assume, that most of people interested in GIS, geography or tourism has this application on their computers.
Basically the hyperlink from some document to the .kml file is straightforward, likewise a link to the map described above. Here we’ve got an option to hyperlink our .kml stuff offline, directly from our disk (Pic. 6).
The only gripe is, that usually our .kml file includes more than one object (placemark) based in its directory. If you want to gain a rough location for your MS Excel cell or some object in your document (in my case it was one of the point of my honeymoon journey), then the easiest way will be an extraction of the object from the .kml file. You can do it in Google Earth. When load your main .kml file you must open its content and find a specific placemark, which you need (Pic. 7).
Once we find our placemark (Pic 8), we can download it to our private directory after right click and next hyperlink it to our document.
Afterwards you will be redirected directly to the location in Google Earth (Pic. 10).
An only demerit here is obviously the scale. Google Earth zoom after loading is set to maximum value, which closes-up our object as much as possible. This is nothing bad, although sometimes we would like to get around the area and make sure, that we hyperlinked a right place. Unfortunately the .kml files are not equipped with zoom factor at the XML code stage and only what you can do here is zooming out via Google Earth. Alternatively you can start work with regions, where through the command you can the coordinate borders for your point as per below (Pic. 11, 12).
After these small alterations of your .kml file you can save it and open in Google Earth again (Pic. 13).
So great! You have got your placemark with an optional enlargement, where you can instantly make sure, that surrounding area is correct. However there is still one issue, which can annoy an user a bit. This is obviously a thin gray rectangle, that frames our region selected previously in XML code. To get rid of it we can simply thick off this element in our .kml file directory at sideline toolbar (Pic. 14).
Remember, that this solution refers only for situation, when your file comes from the computer directory. I believe, that more often nowadays the .kml files are based in the web, i.e in Google Spreadsheet. There you can also link your document to the specified placemark included in a whole .kml directory (Google Spreadsheet mapping), which was detaily explained here.
3. LINK THE GOOGLE MYMAPS OBJECT TO THE DOCUMENT
Link some object (placemark) created in GoogleMyMaps is unfortunately a tricky issue. First of all GoogleMyMaps doesn’t support a hyperlink directly from the interface neither for point nor for linear objects (Pic. 15). Using at least a different interactive map builder will be beneficial, if you don’t want to fight with XML code.
The best for this purpose I believe is the Scribble Maps interactive map builder, being widely common between another dozen or so similar platforms. If you wish to have all placemarks linked, then you must generate the .kml file from your Google MyMap (or some single layer, when applicable)(Pic. 16, 17) and save it somewhere in your directory (Pic. 18).
After this, you should import your file into new Scribble Map, which will open automatically after loading (remember to drag to your placemark locations!). At first glance, your placemark group won’t look fine. This is because the Scribble Maps doesn’t support icons from Google MyMaps (Pic. 19), although don’t worry about it, because when you do the saving and uploading in reverse sequence, then you retrieve all icons in Google MyMaps again.
Having your .kml embedded in the Scribble Map interactive builder you can start to edit every single placemark, adding a link into the description.
On the new, single example I will show you how to do it effectively.
Well, I have created a single placemark, which is called a Lacher See (a volcanic lake in west Germany). Now, after open its editor I have a few options to input a link i.e picture, Youtube, etc. For us the most important is an anchor-looking signature (Pic. 20) called “Add link”.
Let’s input some random URL path, let that be some informative website about this place, which for instance the Wikipedia is. Obviously don’t forget to set an “Open in new window” option (Pic. 21).
We can add up more, than 1 link to a specified website, attaching for example a restaurant and hotel nearby (Pic. 22).
Apart from a link only, you can embed both Youtube movie or picture (Pic. 23). Think over adding a picture as a link through the Scribble Map, because this builder require the URL to the picture (Pic. 25), which not always work (Pic. 26). It will be better to fill up in Google MyMaps later (Pic. 27), alternatively your picture have been already attached before you made a .kml file.
Both your Youtube and image file either in Google MyMaps or Scribble Maps should be loaded automatically, showing you a graph miniature inside the placemark description (Pic. 24). Then you can be sure, that everything is fine with your link.
Returning to the images issue and their disappearance in Google Earth, we can use a Google MyMaps to check if our link is supported by GoogleUserContent at all. If so, you should have a graph loaded, if not, then you receive info like this (Pic. 27).
In general, the links like Flickr or Wikimedia are not supported. In this case better is download your picture first to the computer, and then upload to GoogleMyMaps from your drive.
When you add up everything, then you can generate a .kml file in Scribble Maps, download it, and upload to Google MyMaps. A basic demerit is, that every single .kml file in Google MyMaps is treated as a separate layer, which really restricts our work there, because Google MyMaps provides 8 layers only. At the outcome you are able to import a 8 single .kml files only. Much better is, when your .kml file includes all placemarks, that you need, unlike to my example provided.
Anyway, the link should be clearly visible in your Google MyMap now (Pic. 28-30).
As you may have noticed, the hyperlinks are available, however did we really want them in form such that? We would rather to have a main text hyperlinked instead of having these long hypertexts underneath.
So we can somewhat do this in Scribble Maps. However we cannot write the text outside our link, because it won’t work. We cannot also select our text and mar as a hyperlink. One thing, that we can do is start writing our text inside the existing hyperlink (Pic. 31) and remove not needed pieces as shown below.
Ok, when you prepare your hyperlinked text, then save your placemark, create the .kml file and import it to Google MyMaps. Unfortunately the Google MyMaps doesn’t support solution like this, although your information will still look better, than previously (Pic. 32).
In the result of manual hyperlink edition in Scribble Maps you should get a solution in Google MyMaps as above. Your text won’t be linked, as you would like, although the form with bracketed link path can be accepted in general.
At the finish of the link issues in Google MyMaps I would like to show a link options supported by this platform (Pic. 33).
Fortunately, the Google Earth reads our hyperlink properly (Pic. 34).
4. LINK THE .KML FILE TO THE DOCUMENT
Another important element is a link the .kml file, placed in Google Earth to the document. A basic placemark with one or more hyperlinks looks as per in the picture above (Pic. 34), where you can see a linked information inside the description. These links can redirect both to URL’s and to some particular documents, placed on your hard drive.
If we would consider to take a look on our link structure in XML code, then it could look like this (Pic. 35).
The most important is the ![CDATA[…]] command, which enables us to input a HTML or CSS code inside. Then we can both create a link to some document or URL, directly from .kml file or styling the .kml decription, which will be discussed in the future.
The picture above shows us all links used by myself for purpose of this article (red frame). This is a simple HTML code with content and tags, dividing our description correctly. As you could spot, you have another placemark included in your .kml file with similar ([CDATA![…]]) description, as shown underneath (yellow frame). In the Google Earth our file will look as per in the picture below (Pic. 37).
Now we have got everything, what we need: Youtube link, text link and image link. Remember, that there are some troubleshoots with image links in Scribble Maps, which has been mentioned earlier. Frankly speaking some image URL links are not supported in that interactive image builder and better is input them manually in the XML code, as above (Pic. 36, 37).
Our .kml file may include also linear objects along with placemarks. However in this case we cannot rely on Scribble Maps at all, because this interactive platform features the text and link editor for point objects only. As far as we know, the description of linear object is also possible, at least in Google MyMaps platform (Pic, 15), which unfortunately doesn’t support text link editor.
In this case we must resort to the XML code again and implement the object features manually (Pic. 38).
Afterwards we can see a nice effect in Google Earth (Pic. 38).
Probably you spotted, that I input something special to this code. I decided to spice it up a bit and bring some CSS style codes inside in order to change the hyperlink text from thin blue to strong red. This stuff will be better explained in a separate article in the future.
An analoguous work should be done for some path or trail, which is also a linear object (Pic. 40, 41).
I hope, that all these information will be helpful for you. As you have seen, the link management in .kml files can work on two different ways. One of them are an interactive map builders, which are the easiest and the quickest way to manipulate. However in some cases, using the XML code in external software, like Notepad++ can be also required. It obviously doesn’t change the fact, that the link management in all .kml files is relatively simple issue.
1. Gibson R., Erle S., 2006, Google Maps Hacks, O’Reilly Media Inc, North Sebastopol, CA
- Google Earth outreach: Mapping from a Google spreadsheet
- Keyhole Markup Language standard
- KML 2.1 tutorial
- KML reference
- XML managing data exchange – Google Earth
- Using Google Sites to host your KML
- Adding images to a Google Earth placemark
- Hyperlinking placemarks within a KML file
- Opening a kml file with Google Earth at a specific placemark
- Network Linked KML to a Folder of KMLs
- How do I link to internal files in a KMZ file?
- Creating Links to PDF’s of boring logs in Google Earth
- Set zoom after loading KML layer
- Setting zoom level in KML/KMZ file?
- Working HREF inks in KML files stop working when zipped into a KMZ files
- Google Maps zoom gets overridden, when using a KML file