Help: Map Packages

Cartograph 2.2.9 and later supports map packages which can include maps, styles, and POIs in a single compressed zip file. Map packages are imported into the application like normal maps. The package must include a JSON formatted file "mapdetails.json". The package is a zip file with the file extension ".cpkg". An example file can be downloaded here (rename the file to .zip to open it). The format of the JSON file is as follows:

{
	"version": 2,
	"extracted_size_mb": 117,  // the extracted size of all data contained in the package
	"elevationdata": [ // optional
		"*.hgt"  // a list of hgt elevation files. Use *.hgt to copy all hgt files contained in the package.
	],
	"scripts": [ // optional
		{
			"file": "locusaction.xml",  // a script to be executed. The script can for instance download HGT files from a server.
			"scriptType": "locusaction" // the script type. E.g. "locusaction" for Locus action scripts.
		}
	],
	"maps": [ // optional
		{
			"name": "Sample Mapsforge multi-map",
			"folder": "Sample Map Folder", // the maps are grouped in this folder. Leave this empty for omitting folder creation.
			"type": "multi_map", // possible values are "map" (a standard single map) and "multi_map" (a Mapsforge multi map).
			"load_in_layer": 0,  // -1: do not load, 0: load in map layer, 1: load in overlay map layer.
			"uniqueId": "multiMap1" // If the unique id string is non-empty then existing maps with the same id will be removed before importing this map.
		},
		{
			"name": "Sample A",
			"file": "sampleA.map",
			"folder": "Sample Map Folder",
			"type": "map",
			"load_in_layer": -1,
			"uniqueId": "mapA",
			"multiMapId": "multiMap1" // The map is added to the mulit-map with the uniqueId "multiMap1"
		},
		{
			"name": "Sample B",
			"file": "sampleB.map",
			"folder": "Sample Map Folder",
			"type": "map",
			"load_in_layer": -1,
			"uniqueId": "mapB",
			"multiMapId": "multiMap1"
		},
		{
			"name": "Sample overlay map",
			"file": "sampleC.map",
			"folder": "Sample Map Folder",
			"type": "map",
			"load_in_layer": 1,
			"uniqueId": "mapC",
			"multiMapId": ""
		},
		{
			"name": "Sample online map",
			"file": "testmap.onlinemap",
			"folder": "Sample Map Folder",
			"type": "map",
			"load_in_layer": -1,
			"uniqueId": ""
		}
	],
	"styles": [ // optional
		{
			"file": "samplestyle.zip",
			"load_in_layer": 0, // -1: do not load, 0: load in map layer, 1: load in overlay map layer.
			"uniqueId": "abc", // If the unique id string is non-empty then existing styles with the same id will be removed before importing this style.
			"options": {
				"hillshading": "true" // if true then hillshading is enabled for this style be default.
			}
		}
	],
	"overlays": [ // optional
		{
			"file": "sampleA.poi",
			"load": false,
			"uniqueId": "abc1"
		},
		{
			"file": "sampleB.poi",
			"load": false, // if true then the POI file is loaded.
			"uniqueId": "abc2" // If the unique id string is non-empty then existing overlays with the same id will be removed before importing this overlay.
		}
	],
	"commands": [ // optional
		{
			"command": "mapposition", // The map position after all maps have been imported.
			"lat": 28.61,
			"lon": -15.5,
			"zoom": 10
		},
		{
			"command": "preimportmessage", // an optional message shown before importing.
			"title": {
				"default": "Information"
			},
			"message": {
				"default": "The Sample Map package will now be installed. This can take several minutes.",
				"de": "Das Sample Kartenpaket wird jetzt installiert."
			}
		},
		{
			"command": "postimportmessage", // an optional message shown after importing.
			"title": {
				"default": "Success",
				"de": "Erfolg"
			},
			"message": {
				"default": "The Sample Map package has been installed.",
				"de": "Das Sample Kartenpaket wurde installiert."
			}
		},
		{
			"command": "openwebsiteafterinstallation", // open a website after importing.
			"url": "http://www.cartograph.eu"
		}
	]
}