Pastebin

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
= Overview =

Custom map sources which uses a similar URL scheme as Google/OpenStreetMap can be added to MOBAC. 
There are several types of map sources. Most of them are defined in an xml file in the <tt>mapsources</tt> directory. 

Note: For simple testing a custom XML map source you can also use [[MapEvaluator]]. Simply copy and paste the content of an custom map source XML file into the editor and execute it.

== Simple custom map sources ==
The following section shows is an example how the xml file has to be formatted. It defines an additional map source named "Custom OSM Mapnik" which shows map tiles identical to the predefined map source "OpenStreetMap Mapnik".

 <?xml version="1.0" encoding="UTF-8"?>
 <[[#customMapSource|customMapSource]]>
    <[[#name|name]]>Custom OSM Mapnik</name>
    <[[#minZoom|minZoom]]>0</minZoom>
    <[[#maxZoom|maxZoom]]>18</maxZoom>
    <[[#tileType|tileType]]>png</tileType>
    <[[#url|url]]><nowiki>http://tile.openstreetmap.org/{$z}/{$x}/{$y}.png</nowiki></url>
    <[[#tileUpdate|tileUpdate]]>None</tileUpdate>
    <[[#backgroundColor|backgroundColor]]>#000000</backgroundColor>
    <[[#ignoreErrors|ignoreErrors]]>false</ignoreErrors>
    <[[#serverParts|serverParts]]></serverParts>
 </customMapSource>

The most important part of this definition is the <[[#url|url]]> entry. It is a template containing specific placeholders, which are encapsulated by curly braces, and specify the requested tile. 

;Example file for download:  [https://mobac.svn.sourceforge.net/svnroot/mobac/trunk/MOBAC/mapsources/Example%20custom%20map%20source.xml Example custom map source.xml]

==  Custom WMS map sources ==
A WMS server can be defined as a map source. Currently only EPSG:4326 is supported as the coordinate system .

 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <[[#customWmsMapSource|customWmsMapSource]]>
    <[[#name|name]]>TerraServer WMS</name>
    <[[#minZoom|minZoom]]>12</minZoom>
    <[[#maxZoom|maxZoom]]>18</maxZoom>
    <[[#tileType|tileType]]>JPG</tileType>
    <version>1.1.1</version>
    <layers>DRG</layers>
    <url><nowiki>http://terraserver-usa.com/ogcmap6.ashx?</nowiki></url>
    <coordinatesystem>EPSG:4326</coordinatesystem>
    <aditionalparameters>&amp;EXCEPTIONS=BLANK&amp;Styles=</aditionalparameters>
    <[[#backgroundColor|backgroundColor]]>#000000</backgroundColor>
 </customWmsMapSource>

;Example file for download: [https://mobac.svn.sourceforge.net/svnroot/mobac/trunk/MOBAC/mapsources/Example%20custom%20WMS%20map%20source.xml Example custom WMS map source.xml]

== Custom CloudMade map sources ==
The [http://maps.cloudmade.com/ CloudMade map service] offers a large number of OpenStreetMap based maps with different styles. Each style is accessible through it's styleID . Custom CloudMade maps can be added to MOBAC via a simple XML file containing a map name used by MOBAC and a styleID:

 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <[[#cloudMade|cloudMade]]>
    <displayName>CloudMade Fine Line</displayName>
    <styleID>2</styleID>
 </cloudMade>

;Example file for download: [https://mobac.svn.sourceforge.net/svnroot/mobac/trunk/MOBAC/mapsources/Example%20CloudMade%20Fine%20Line.xml Example CloudMade Fine Line.xml]