Index: resources/help/en/options =================================================================== --- resources/help/en/options (revision 1569) +++ resources/help/en/options (working copy) @@ -370,6 +370,11 @@ --tdbfile Write a .tdb file. +--show-profiles=1 + Sets a flag in tdb file which marks set mapset as having contour + lines and allows showing profile in MapSource. Default is 0 + which means disabled. + --draw-priority=25 When two maps cover the same area, this option controls what order they are drawn in and therefore which map is on top of Index: src/uk/me/parabola/mkgmap/combiners/TdbBuilder.java =================================================================== --- src/uk/me/parabola/mkgmap/combiners/TdbBuilder.java (revision 1569) +++ src/uk/me/parabola/mkgmap/combiners/TdbBuilder.java (working copy) @@ -84,10 +84,17 @@ } else { tdbVersion = TdbFile.TDB_V407; } + // enable "show profile" button for routes in mapsource + byte enableProfile = 0; + if (tdbVersion == TdbFile.TDB_V407) + { + // this is supported only in version 403 and above + enableProfile = (byte)args.get("show-profiles", 0); + } tdb = new TdbFile(tdbVersion); tdb.setProductInfo(familyId, productId, productVersion, seriesName, - familyName, areaName); + familyName, areaName, enableProfile); } /** Index: src/uk/me/parabola/tdbfmt/HeaderBlock.java =================================================================== --- src/uk/me/parabola/tdbfmt/HeaderBlock.java (revision 1569) +++ src/uk/me/parabola/tdbfmt/HeaderBlock.java (working copy) @@ -49,6 +49,8 @@ */ private String familyName; + private byte enableProfile; + HeaderBlock(int tdbVersion) { this.tdbVersion = tdbVersion; } @@ -92,8 +94,12 @@ os.write3(0); os.write4(1252); os.write4(10000); - os.write(1); - os.write2(0); + os.write(1); // map is routable + if (enableProfile == 1) + os.write(1); // map has profile information + else + os.write(0); + os.write(0); // map has DEM sub files } } @@ -154,4 +160,8 @@ public int getTdbVersion() { return tdbVersion; } + + public void setEnableProfile(byte enableProfile) { + this.enableProfile = enableProfile; + } } Index: src/uk/me/parabola/tdbfmt/TdbFile.java =================================================================== --- src/uk/me/parabola/tdbfmt/TdbFile.java (revision 1569) +++ src/uk/me/parabola/tdbfmt/TdbFile.java (working copy) @@ -92,7 +92,8 @@ } public void setProductInfo(int familyId, int productId, - short productVersion, String seriesName, String familyName, String overviewDescription) + short productVersion, String seriesName, String familyName, String overviewDescription, + byte enableProfile) { headerBlock = new HeaderBlock(tdbVersion); headerBlock.setFamilyId((short) familyId); @@ -100,6 +101,7 @@ headerBlock.setProductVersion(productVersion); headerBlock.setSeriesName(seriesName); headerBlock.setFamilyName(familyName); + headerBlock.setEnableProfile(enableProfile); this.overviewDescription = overviewDescription; }