<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Does anyone know how to add map text programmatically? in ArcGIS Explorer Desktop Questions</title>
    <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/does-anyone-know-how-to-add-map-text/m-p/493272#M2995</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The AGX version 2500 supports map text, either fixed to a specific location on earth's surface, or positioned relative to the map display (e.g, always top center, regardless of where user zooms.) However, the SDK was unchanged from version 1750. I'd like to create text programmatically in an add-in but don't see how to do that. To do this, I need to create something (graphic, text overlay, ?) but don't see any constructor for this type of text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any suggestions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Ellen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Aug 2015 18:48:18 GMT</pubDate>
    <dc:creator>EllenBryson2</dc:creator>
    <dc:date>2015-08-06T18:48:18Z</dc:date>
    <item>
      <title>Does anyone know how to add map text programmatically?</title>
      <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/does-anyone-know-how-to-add-map-text/m-p/493272#M2995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The AGX version 2500 supports map text, either fixed to a specific location on earth's surface, or positioned relative to the map display (e.g, always top center, regardless of where user zooms.) However, the SDK was unchanged from version 1750. I'd like to create text programmatically in an add-in but don't see how to do that. To do this, I need to create something (graphic, text overlay, ?) but don't see any constructor for this type of text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any suggestions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Ellen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 18:48:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-explorer-desktop-questions/does-anyone-know-how-to-add-map-text/m-p/493272#M2995</guid>
      <dc:creator>EllenBryson2</dc:creator>
      <dc:date>2015-08-06T18:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: Does anyone know how to add map text programmatically?</title>
      <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/does-anyone-know-how-to-add-map-text/m-p/493273#M2996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ellen, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is some code that I wrote to create a "dirty dot" (i.e. changed color as more changes were made to the map) that creates an overlay dot programmatically. It is also changing the size and color of the dot programatically based on the number of changes. Basically you are creating an imageoverlay graphic, then adding that ImageOverlay to the map's ForegroundOverlays collection.&amp;nbsp; These are all undocumented in the API; I found them by simply reading through the different routines. &lt;/P&gt;&lt;P&gt;//set up the characteristics of the dirty dot that won't change&lt;/P&gt;&lt;P&gt;ddotOverlay = new ImageOverlay("DirtyDot", ESRI.ArcGISExplorer.Mapping.Symbol.Marker.Sphere.Green.GetBitmap());&lt;/P&gt;&lt;P&gt;ddotOverlay.SizeMode = SizeMode.Absolute;&lt;/P&gt;&lt;P&gt;ddotOverlay.DisplayPosition = DisplayPosition.TopLeft;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Actually creating the new dot and adding it to the overlay graphics collection&lt;/P&gt;&lt;P&gt;Symbol ddotSymbol = null;&lt;/P&gt;&lt;P&gt;ddotSymbol = ESRI.ArcGISExplorer.Mapping.Symbol.Marker.Sphere.Green;&lt;/P&gt;&lt;P&gt;int dotsize = 16 + (8 * ChangeCounter);&lt;/P&gt;&lt;P&gt;ddotOverlay.ChangeImage(ddotSymbol.GetBitmap(dotsize, dotsize));&lt;/P&gt;&lt;P&gt;ddotOverlay.Transparency = 100 - (12 * ChangeCounter); //Change level of transparancy of dot based on the number of changes&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ESRI.ArcGISExplorer.Mapping.MapDisplay _mapDisp = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay;&lt;/P&gt;&lt;P&gt;ImageOverlayOrderCollection OverlayCollection = _mapDisp.ForegroundOverlays;&lt;/P&gt;&lt;P&gt;if (OverlayCollection.Contains(ddotOverlay))&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;OverlayCollection.Remove(ddotOverlay);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;OverlayCollection.AddToTop(ddotOverlay);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The process is much easier for adding non-overlay graphics (I.e. attached to a specific map coordinate). Simply create a variable pointing to the ActiveMapDisplay Graphics collection, then add any map graphics to that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;private GraphicCollection _graphics = null;&lt;/P&gt;&lt;P&gt;_graphics = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Graphics;&lt;/P&gt;&lt;P&gt;Graphic gPt = new Graphic([AGX point here]);&lt;/P&gt;&lt;P&gt;gPt.Symbol = Symbol.Marker.Sphere.Blue;&lt;/P&gt;&lt;P&gt;_graphics.Add(gPt);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know that these are only for symbols, not text, but I know you can do it with similar processes. Sorry, gone for a few days now so I won't be able to respond till Wednesday. But if you are still stuck then, let me know and I will hunt that the specifics for adding text as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Norm&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2015 03:17:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-explorer-desktop-questions/does-anyone-know-how-to-add-map-text/m-p/493273#M2996</guid>
      <dc:creator>NormanDeschamps</dc:creator>
      <dc:date>2015-08-07T03:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: Does anyone know how to add map text programmatically?</title>
      <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/does-anyone-know-how-to-add-map-text/m-p/493274#M2997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Norm,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks very much. I was hoping you'd pipe in. I took your suggestions and your code and got it working!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For those interested, I've posted the code below. It basically creates an Image Overlay by creating a bitmap from given text, using your desired font, colors, etc and then adding that bitmap to the map as the overlay. Note the use of the Imports System.Drawing.Imaging, which is required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Imports System.Drawing.Imaging&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... (other coding as needed to achieve the goal)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dim mapDisp As MapDisplay = ESRI.ARcGISExplorer.Application.Application.ActiveMapDisplay&lt;/P&gt;&lt;P&gt;Dim overlayColl As ImageOverlayOrderCollection = mapDisp.ForegroundOverlays&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'create the text you want to appear. set colors, foreground, background, font size, etc.&lt;/P&gt;&lt;P&gt;Dim overlayText As String = "Here's the text I'd like to appear"&lt;/P&gt;&lt;P&gt;Dim BackColor As Color = Color.Orange&lt;/P&gt;&lt;P&gt;Dim FontColor As Color = Color.White&lt;/P&gt;&lt;P&gt;Dim borderColor As Color = Color.Black&lt;/P&gt;&lt;P&gt;Dim fontName As String = "Calibri"&lt;/P&gt;&lt;P&gt;Dim fontSize As Integer = 16&lt;/P&gt;&lt;P&gt;dim objFont As New Font (fontName, fontSize)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dim height As Integer = fontSize * 2&lt;/P&gt;&lt;P&gt;Dim width As Integer = 400&lt;/P&gt;&lt;P&gt;Dim myPen As System.Drawing.Pen = New Pen(borderColor,2)&lt;/P&gt;&lt;P&gt;Dim objPoint As New PointF(5.0F,5.0F) 'this is not an esri point. it's a system drawing point&lt;/P&gt;&lt;P&gt;Dim objBrushForeColor As New SolidBrush(fontColor)&lt;/P&gt;&lt;P&gt;Dim objBrushBackColor As New SolidBrush(backColor)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;'make a new bitmap at the desired size&lt;/P&gt;&lt;P&gt;dim objBitmap As New bitmap(width,height)&lt;/P&gt;&lt;P&gt;'make a graphic from this empty bitmap&lt;/P&gt;&lt;P&gt;Dim objGraphics As Graphics =&amp;nbsp; Graphics.FromImage(objBitmap)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'modify the graphic as desired/needed&lt;/P&gt;&lt;P&gt;objGraphics.DrawRectangle(myPen,0,0,width,height)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;objGraphics.FillRectangle(objBrushBackColor,objPoint.x,objPoint.Y,width,height)&lt;/P&gt;&lt;P&gt;objDrawString(overlayText, ojbFont, objBrushForeColor,objPoint)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'now create the image overlay using this bitmap&lt;/P&gt;&lt;P&gt;Dim indOverlay As ImageOverlay = New ImageOverlay("Image Source",objBitmap)&lt;/P&gt;&lt;P&gt;indOverlay.DisplayPosition = DisplayPosition.TopCenter&lt;/P&gt;&lt;P&gt;mapDisp.Map.ImageOverlayDrawingOrder.AddToTop(indOverlay)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks again Norm&lt;/P&gt;&lt;P&gt;'editors note. changes were made throughout on 9/7/2015. several errors were found&lt;/P&gt;&lt;P&gt;~Ellen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Aug 2015 16:02:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-explorer-desktop-questions/does-anyone-know-how-to-add-map-text/m-p/493274#M2997</guid>
      <dc:creator>EllenBryson2</dc:creator>
      <dc:date>2015-08-10T16:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: Does anyone know how to add map text programmatically?</title>
      <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/does-anyone-know-how-to-add-map-text/m-p/493275#M2998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad I could help Ellen. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been looking at the ImageOverlay class, and there are a number of hidden properties for creating text directly within the class without having to create a bitmap of the text (or at least that is what it seems). There are hidden properties for font, font size, transparency, color, etc. However, I couldn't figure out how to create such overlays, since all of the methods available require a bitmap, as you have done. I'm sure it has something to do with how you can create overlay text for slides, but I would have to play more with it to figure out exactly how it works. Might be worth looking into if you run into trouble with having the text display cleanly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you have done such an excellent job with your solution, you should mark your question as answered, so others can be assured that it is worth reading through this thread to solve this problem!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Norm&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 00:47:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-explorer-desktop-questions/does-anyone-know-how-to-add-map-text/m-p/493275#M2998</guid>
      <dc:creator>NormanDeschamps</dc:creator>
      <dc:date>2015-08-12T00:47:59Z</dc:date>
    </item>
  </channel>
</rss>

