====== Real-Time information sharing with KML & Google Docs ======
----
===== Basic information =====
**Author:** berkley
===== How to =====
I found a very nice way of managing the information you need on some POIs and tracks. Especially for information that changes very often.
__What we'll gonna do:__
* Creating this [[https://docs.google.com/open?id=0BwG8sRcjn3q6N3dsZjVEYnZRenlzTVFwLTQ1R1J0UQ|KML File]]
* Enter data in a [[https://docs.google.com/spreadsheet/ccc?key=0AgG8sRcjn3q6dDVnM1B3Z0ZGdEs3TU4zdFlYUlhDd2c|Google Doc]]
* Edit your data and see changes in Locus Map
__What you need on your phone:__
* [[https://play.google.com/store/apps/details?id=menion.android.locus.pro|Locus Map]]
* [[https://play.google.com/store/apps/details?id=com.google.android.apps.docs|Google Docs]]
__What you need on your Desktop PC:__
* a text editor, i prefer Notepad++, but it works with others too
* Google Earth
==== (1) Create your kml file with Google Earth ====
Create a new folder in Google Earth and give it a name. Create 3 new points. Doesn't matter where these points are. Give them names. In this example, I've chosen "POI 1", "POI 2" and "POI 3". Right-click on the folder name and click "save location...". Save as kml file.
I created a sample file that you can download [[https://docs.google.com/open?id=0BwG8sRcjn3q6NTEyQjctcy1UUnVSVVJTZ0tNek1UQQ|here >>]]
==== (2) Create the Spreadsheet on Google Docs ====
Log in to Google Docs: [[https://docs.google.com/]] and create a new spreadsheet with 3 sheets called "POI 1", "POI 2" and "POI 3".
Enter your information for every POI you created in step (1). You can use all features that comes with Google Docs. In general, you can do this with every kind of Google Docs (Document, Presentation, Table,...), but for this example, I'll stay with a spreadsheet.
Same as in step (1), i created a sample spreadsheet, that you can use with the kml file, that gets linked later on [[https://docs.google.com/spreadsheet/ccc?key=0AgG8sRcjn3q6dDVnM1B3Z0ZGdEs3TU4zdFlYUlhDd2c|here >>]]
==== (3) Get the URL for every sheet ====
On the menu bar in Google Docs click on "File -> Publish to the Web". (Btw, no need for sharing options!)
On the dialog under "Sheets to publish" choose "POI 1"and click "Start publishing".
Under "Get link to the published data, choose "WebPage" and "POI 1")
For our example, we'll get this link:
https://docs.google.com/spreadsheet/pub?key=0AgG8sRcjn3q6dDVnM1B3Z0ZGdEs3TU4zdFlYUlhDd2c&single=true&gid=0&output=html
The interesting part about this link is almost at the end: "gid=0". The sheets are counted from 0. So sheet 1 or "POI 1" is gid=0. POI 2 is gid=1.
==== (4) Adding description to the kml from step (2) ====
It's getting a bit tricky now, I hope you understand this part :D
Now you open your .kml in your favorite text editor. You should see something like this for every point:
POI 1
12.4644505116075,51.2073920580829,0
What we now do is adding the description to this POI. between the tags and , we'll add the description tag: "". In addition with iframe, we'll get our Google Spreadsheet working. Your code should now look like this now:
POI 1
]]>
12.4644505116075,51.2073920580829,0
where the additional tags mean:
* scrolling="yes": options yes or no. En- or disable scrolling
* width="500" height="600": the width and the height for the iframe
* frameborder="0": options 0 and 1. display a border around the iframe
Do this procedure for every POI in the description.
You should get [[https://docs.google.com/open?id=0BwG8sRcjn3q6N3dsZjVEYnZRenlzTVFwLTQ1R1J0UQ|this file >>]]
==== (5) Open this kml in Locus Map ====
Now open this file in Locus Map and see how it works.
As this is a kml file, you can import it or use it in MapsItemsManager.
Click on a POI and see the description. Make changes on the Google Document, wait 5 minutes for the next auto-refresh and your changes are there!
This is just a tutorial to get started. There are plenty of possibilities for iframes used in a kml file in combination with Google Docs. Imagine the possibilities!!!
Furthermore, there is CSV Import available. The export of the Spreadsheet can be changed from "output=html" to "output=csv" and you'll get an updated and always synced CSV file for import to Locus...
Cheers, berkley