Locus Actions
This mysterious name hides a very simple way of providing an easy method of downloading data from your own web server to Locus Map (and probably other features will come later). The whole concept is based on an XML file that you provide to Locus Map for processing. The XML file describes what to do.
Locus Map currently supports only these actions:
How to
The whole file you provide to Locus is an XML file with this syntax:
<?xml version="1.0" encoding="utf-8"?>
<locusActions>
<action>...</action>
</locusActions>
Where locusActions may contain one or more action objects that will do the required work.
To make Locus Map handle this file correctly, simply construct a URL to this file with the following syntax (example):
locus-actions://https/dl.dropbox.com/u/12579512/my_directory/test.xml
As you can see, changing simply the scheme to locus-actions and the default scheme changes to a part of the base URL separated only by one slash. Locus Map will simply handle this link:
removes locus-actions tag
changes the first part into a new scheme
Download
An action object that serves downloading files into the Locus directory.
Sample syntax is:
<?xml version="1.0" encoding="utf-8"?>
<locusActions>
<download>
<source size="22075830" date="2012-06-29_19-11-54">
<![CDATA[http://.../map.tar]]>
</source>
<dest><![CDATA[/maps/map.tar]]></dest>
<after>...</after>
</download>
</locusActions>
Where
download - a core tag that identifies this action
source -
URL to source file. If it contains
size and
date parameters, the download file will be checked and not downloaded if it already exists.
size - (optional) size of the file in bytes
date - (optional) date of the last edit of format yyyy-MM-dd_HH-mm-ss. Some phones have problems with setting the correct time for the downloaded file. It is highly recommended to set only size for comparing already downloaded files.
dest - alternate path (to Locus root) where to put the new file
after - special action that is performed after download. Currently supported:
refreshMap - useful if you download a new personal or vector map. This calls on the last map (in case you download more maps) and refreshes the list of maps without the need to restart Locus
importData - immediately after the file is downloaded, Locus Map starts the common import process of this file
displayData - immediately after download, Locus Map loads and displays the downloaded file on the map. Data will be displayed only temporarily, so if you want to store it permanently, use importData option instead
extract - extracts downloaded file. The directory is the same as for download.
deleteSource - allows deletion of the downloaded file. This is useful mainly if you download a zipped file, and after extracting it, you want to remove it.
TIPS
Download map file (zip archive) - you may use this combination extract|deleteSource|refreshMap, which extracts the file after download, deletes the original file, and finally refreshes the maps list.
Download file ready for import (zip archive) - you may use this combination extract|importData, which extracts the file after download and starts import. In this case, it is suggested to set the dest parameter to the special Locus Map directory cache/temp. This directory is cleared from time to time, so all unneeded files are removed.
Event
An action that triggers a certain action.
Sample syntax is:
<?xml version="1.0" encoding="utf-8"?>
<locusActions>
<event>
<key>setMapVector</key>
<value><![CDATA[ /mapsVector/DownloadedMap.map ]]></value>
</event>
</locusActions>
Where