public void BuildElevationSample() { MapMakerSettings mapMakerSettings = new MapMakerSettings(); mapMakerSettings.CharactersConversionDictionary.AddConversion('Č', "C"); mapMakerSettings.CharactersConversionDictionary.AddConversion('č', "c"); const string expression = @"name ++ "" sdsd"" ++ ele "" ($1f$elevation)"""; LabelExpressionParser parser = new LabelExpressionParser(); LabelExpression parsedExpression = parser.Parse(expression, 0); OsmNode osmNode = new OsmNode(1, 10, 10); osmNode.SetTag("name", "Veliki vrh Čačka"); osmNode.SetTag("ele", "1433"); string label = parsedExpression.BuildLabel(mapMakerSettings, osmNode, null); Assert.AreEqual("Veliki vrh Cacka sdsd (~[0x1f]1433)", label); }
public InMemoryOsmDatabase Provide() { InMemoryOsmDatabase osmDatabase = new InMemoryOsmDatabase(); for (int i = 0; i < pointTypesCount; i++) { OsmNode node = new OsmNode(i + 1, 15 + (i % width) * 0.1, 46 + (i / width) * 0.1); node.SetTag("garmin_icon", i.ToString(CultureInfo.InvariantCulture)); osmDatabase.AddNode(node); } return(osmDatabase); }