Translated from English by gtranslate.io
A example of OpenPiste map (OSM based) created from three layers:
Referer added to the header is not recommended in this case.
<?xml version="1.0" encoding="UTF-8"?> <providers> <provider id="1000" type="0" visible="false" required="true" background="-1"> <name>OSM</name> <mode>background</mode> <url><![CDATA[http://tiles.openpistemap.org/nocontours/{z}/{x}/{y}.png?v={ts}]]></url> <zoomPart>{z}-8</zoomPart> <zoomMin>8</zoomMin> <zoomMax>24</zoomMax> <tileSize>256</tileSize> <tileScale dpi="0" multi="2.0" replace="19" /> <extraHeader>Referer#http://locus.asamm.cz/</extraHeader> </provider> <provider id="1001" type="0" visible="false" required="false" background="1000"> <name>OSM</name> <mode>contours</mode> <url><![CDATA[http://tiles.openpistemap.org/contours-only/{z}/{x}/{y}.png?v={ts}]]></url> <zoomPart>{z}-8</zoomPart> <zoomMin>8</zoomMin> <zoomMax>24</zoomMax> <tileSize>256</tileSize> <tileScale dpi="0" multi="2.0" replace="19" /> <extraHeader>Referer#http://locus.asamm.cz/</extraHeader> </provider> <provider id="1002" type="0" visible="true" required="false" background="1001"> <name>OSM</name> <mode>OpenPiste</mode> <url><![CDATA[http://tiles2.openpistemap.org/landshaded/{z}/{x}/{y}.png?v={ts}]]></url> <zoomPart>{z}-8</zoomPart> <zoomMin>8</zoomMin> <zoomMax>24</zoomMax> <tileSize>256</tileSize> <tileScale dpi="0" multi="2.0" replace="19" /> <countries>World</countries> <usage>hiking,ski</usage> <extraHeader>Referer#http://locus.asamm.cz/</extraHeader> </provider> </providers>
<serverPart>({x}+{y})%4</serverPart>
ZoomValues (zoomMin, zoomMax) have to be counted as valid zoom level by 2^x. So the whole World has one tile 256×256 px, which means 2^8, so X = 8!. That's why almost all maps in Locus start with zoomMin = 8 but have zoomPart {z} - 8. This is because in URLs zooms usually start from 0 to some max value.
This solution should be improved so if you have any ideas, tell us. Also, an experienced Android developer on should be able to create some mechanism for adding external providers through ContentProviders or services.
Now you know syntax of providers so you should add your custom ones. Please, share links with others and enjoy!
We recommend to use Firefox browser with extension HttpFox:
Another sample of custom online map can be Strava Global Heatmap XML file that we prepared together with our users. It contains cycling and running layers and can be downloaded here >>. Just unzip it in Locus/mapsOnline/custom directory and enjoy!
If you operate your own map tile server you may need to cancel tile downloading limit that is set in Locus by default in order to maintain decent downloading traffic per application: