Correction to gmap4 map viewer
In an earlier post I indicated that any text in the <Document><description> element of your kml file would become a caption that gets welded to the top of your map. Oops! It was a mistake on my part to initially identify that element as the one where gmap4 would pick up text for a map caption. Instead, please use the <Document><name>
element if you would like a caption on your map.
For example, this is how I coded a three line, bolded caption for the following demo map:
<name><![CDATA[<b>Includes part of County Line<br>trail (faint). GPS tracks<br>from 2004 and 2008.</b>]]></name>
Gmap4 will now ignore anything in the <Document><description> element of kml files.
To read more about adding html to your kml files, and the CDATA tag, please open this link and scroll down a bit:
If you use map captions, then I recommend keeping your caption and <name> tags on a single line in your kml file, like so:
<name><![CDATA[Your caption here. HTML is OK]]></name>
My apologies for any inconvenience this change will cause anyone.
Making changes to your map - &refresh=1
The MASU (MAppingSUpport) server must keep a copy of your kml file in order to display your data via Google maps. If you change the content of your kml file but do not change your file name, then you need to tell gmap4 that it should re-read your file and make a new copy. You can do this by first placing your revised file online and then launching gmap4 with this additional parameter: &refresh=1
For example: http://www.mappingsupport.com/p/gmap4.php?q=http://www.mappingsupport.com/p/kml_demo/county_line_trail_with_pic.kml&ll=47.393527,-120.779657&z=14&refresh=1
After you revise your kml file, you only need to use the refresh parameter one time. Since the refresh parameter causes additional processing, it should not be routinely used. It only needs to be used 1 time after a kml file has been changed.
Google maintains its own cache for kml files. This is different than your browser’s cache. If you make a change to your kml file then you will not see that change in gmap4 until Google decides to refresh its cache of kml files. Sorry about that but it’s out of my hands.
Testing kml files with Google Earth
Google Earth can read and display kml files from your local drive. If you change your file you can tell Google Earth to refresh itself with the revised data. This is a great tool to help you develop a kml file. The problem I described in the prior paragraph regarding the Google cache does not apply if you develop your kml files with Google Earth.
Store your kml files in the Google cloud
This feature is unique to gmap4.
In order for gmap4 to read your kml file, you must place that file online somewhere. And for those that do not have their own website - no worries - you can upload your data to the cloud as a Google document and let Google host your kml/txt file for free. However, since Google documents does not provide native support for kml files, you need to pay attention and follow these instructions:
1. Get a Google account. It’s free.
2. Change the extension on your file from kml to txt. Kml files are a type of text file.
3. Connect to Google documents and login. http://docs.google.com/
4. Spend a little time learning your way around
5. Upload your kml/txt file
6. “Share” your file for viewing by anyone
7. “Publish” your file (check one file box ==> More actions ==> Check the box to “Automatically re-publish” ==> Publish)
8. Copy and save the url you get when you “publish”.
9. Launch gmap4 to view the data in your “published” file:
a real link)
http://www.mappingsupport.com/p/gmap4.p ... _code_here
Here is a link to a different version of the demo map you have already seen. This specific file is stored as a Google document. Note that it does not have any caption at the top of the map. That is because this file does not have any text in the <Document><name> element of the kml file.
Tech note: Google adds a lot of html code to each file that is uploaded into Google documents. After reading one of these kml/txt files, gmap4 unwraps the html and converts the file back into a normal kml file which can then be read by Google maps. This feature is unique to gmap4.
Status of enhancement to support gpx files
The coding is finished and testing is underway. Here’s some insight into how this will work. Google maps understands kml files but does not understand gpx files. After I release this enhancement you will be able to launch gmap4 with the q parameter pointing to a gpx file hosted anywhere online. Gmap4 will read that file and use GPSBabel to convert it to a kml file. That conversion step will use the default settings built into GPSBabel. If those default conversion settings do not give you what you want to see on your gmap4 map, then you will need to run GPSBabel yourself and adjust the conversion settings to produce a kml file more to your liking. You can then place that kml file online somewhere and then display that data with the gmap4 map viewer.
Actually before working on any more enhancements I really need to write v.1 of a ‘help’ file.
High on the list of future enhancements is the ability to click the map and build a list of coordinates. You will be able to copy those coords and save them on your local drive. Of course once the coords are on your drive you can process them with GPSBabel (or various other tools) and convert them into a gpx file or any other kind of file supported by your conversion tool. In this manner you will be able to load coords into your GPS prior to your next trip.
Please let me know if anything seems awry. I will try to check back here periodically but if I seem AWOL you can always email me through my website: http://www.mappingsupport.com/
Since gmap4 is under active development, it is certainly possible that in adding a new feature I will accidentally break something that previously worked fine.