private void WriteBasicMapParameters(IPolishMapFileCreator polishMapFileCreator, CGpsMapperMapWriter mapWriter) { mapWriter .AddSection("IMG ID") .Add("ID", polishMapFileCreator.CurrentMapId) .Add("Name", polishMapFileCreator.CurrentMapName) .Add("Elevation", settings.ElevationUnits.ToString()) .Add("Transparent", DetermineMapTransparencyMode()); float simplifyLevel = DefaultSimplifyLevel; if (Settings.SimplifyLevel.HasValue) { simplifyLevel = Settings.SimplifyLevel.Value; } mapWriter .Add("SimplifyLevel", simplifyLevel); int treSize = DefaultTreeSize; if (Settings.TreSize.HasValue) { treSize = Settings.TreSize.Value; } mapWriter .Add("TreSize", treSize); // write all additional parameters to the map foreach ( KeyValuePair <string, string> mapParameter in settings.AdditionalMapParameters) { mapWriter.Add(mapParameter.Key, mapParameter.Value); } }
protected void GenerateIndividualFile( IPolishMapFileCreator polishMapFileCreator, ITaskRunner taskRunner, string mapFileInfo) { using (CGpsMapperMapWriter mapWriter = new CGpsMapperMapWriter( polishMapFileCreator.CreatePolishMapFile(), mapFileInfo)) { consoleLogger.WriteLine(log, Level.Info, "Generating polish map file..."); WriteBasicMapParameters(polishMapFileCreator, mapWriter); // write down used levels mapWriter.Add("Levels", analysis.LogicalToHardwareLevelDictionary.Count); int logicalLevel = 0; for (int i = analysis.HardwareLevelsUsed.Count - 1; i >= 0; i--) { mapWriter.AddFormat("Level{0}={1}", logicalLevel++, analysis.HardwareLevelsUsed.Keys[i]); } for (int i = 0; i < analysis.HardwareLevelsUsed.Count; i++) { mapWriter.AddFormat("Zoom{0}={1}", i, i); } isEmptyMap = true; GeneratePolishMapFileInternal(mapWriter); mapWriter.FinishMap(); } if (false == isEmptyMap) { taskRunner.RegisterProductFile( new ProductFile( GenerateMapPolishFilesTask.PolishMapFileType, polishMapFileCreator.CurrentPolishMapFileName, true)); } }