protected override void DrawTextCore(string text, GeoFont font, GeoBrush fillBrush, GeoPen haloPen, IEnumerable <ScreenPointF> textPathInScreen, DrawingLevel drawingLevel, float xOffset, float yOffset, float rotateAngle, DrawingTextAlignment drawingTextAlignment) { int id = 0; if (fillBrush != null) { id = fillBrush.GetHashCode(); } if (!styleUrlDictionary.ContainsKey(id)) { string kmlStyle = GetTextStyleKml(id, ((GeoSolidBrush)fillBrush).Color, font.Size); kmlBuilder.Append(kmlStyle); styleUrlDictionary.Add(id, string.Format("<styleUrl>#{0}</styleUrl>", id)); } StringBuilder contentStringBuilder = GetStringBuilder(drawingLevel); contentStringBuilder.AppendLine(); contentStringBuilder.AppendLine(@"<Placemark>"); contentStringBuilder.AppendLine(styleUrlDictionary[id]); text = text.Replace("<", "<"); text = text.Replace(">", ">"); text = text.Replace("`", "'"); text = text.Replace("\"", """); text = text.Replace("&", "&"); contentStringBuilder.AppendLine(@"<name>" + text + @"</name>"); if (textPathInScreen.Count() > 1) { contentStringBuilder.AppendLine(@"<LineString>"); contentStringBuilder.AppendLine(extrudeString); contentStringBuilder.AppendLine(tessellateString); contentStringBuilder.AppendLine(altitudeModeString); AppendCoordinates(textPathInScreen, xOffset, yOffset, contentStringBuilder); contentStringBuilder.AppendLine(@"</LineString>"); } else { contentStringBuilder.AppendLine(@"<Point>"); contentStringBuilder.AppendLine(extrudeString); contentStringBuilder.AppendLine(tessellateString); contentStringBuilder.AppendLine(altitudeModeString); AppendCoordinates(textPathInScreen, xOffset, yOffset, contentStringBuilder); contentStringBuilder.AppendLine(@"</Point>"); } contentStringBuilder.AppendLine(@"</Placemark>"); }
protected override void DrawTextCore(string text, GeoFont font, GeoBrush fillBrush, GeoPen haloPen, IEnumerable <ScreenPointF> textPathInScreen, DrawingLevel drawingLevel, float xOffset, float yOffset, float rotateAngle, DrawingTextAlignment drawingTextAlignment) { List <ScreenPointF> screenPoints = new List <ScreenPointF>(); foreach (ScreenPointF screenPointF in textPathInScreen) { screenPoints.Add(GetScreenPoint(screenPointF)); } GeoFont scaledFont = GetScaledFont(font); canvas.DrawText(text, scaledFont, fillBrush, haloPen, screenPoints, drawingLevel, xOffset, yOffset, rotateAngle); }