<?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 Creating a KmlLayer not working? in ArcGIS Explorer Desktop Questions</title>
    <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/creating-a-kmllayer-not-working/m-p/234660#M1476</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to add a KmlLayer to my Map programmatically.&amp;nbsp; Here is what I am doing:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;MapDisplay _md = null;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;string strMachineName = "testmachine";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;KmlLayer kmlLayer = new KmlLayer(new Uri(@"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://" rel="nofollow" target="_blank"&gt;http://&lt;/A&gt;&lt;SPAN&gt;" + strMachineName + @"/KML/ProjectIndex.kml", UriKind.Absolute));&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;kmlLayer.Name = "Project Index";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_md.Map.ChildItems.Add(kmlLayer);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When this code completes, the item in the Contents list has a red exclamation point in the icon and the tool-tip "Invalid data source".&amp;nbsp; If I double-click it, the "Repair KML Network Link" dialog comes up with the URI that I added to my item.&amp;nbsp; If I click the "Repair" button, the item it "fixed" somehow.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What does this "repair" do to the KML Node?&amp;nbsp; How can I do these fixes from my code?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Jun 2013 21:07:04 GMT</pubDate>
    <dc:creator>JonathanKillen</dc:creator>
    <dc:date>2013-06-18T21:07:04Z</dc:date>
    <item>
      <title>Creating a KmlLayer not working?</title>
      <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/creating-a-kmllayer-not-working/m-p/234660#M1476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to add a KmlLayer to my Map programmatically.&amp;nbsp; Here is what I am doing:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;MapDisplay _md = null;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;string strMachineName = "testmachine";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;KmlLayer kmlLayer = new KmlLayer(new Uri(@"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://" rel="nofollow" target="_blank"&gt;http://&lt;/A&gt;&lt;SPAN&gt;" + strMachineName + @"/KML/ProjectIndex.kml", UriKind.Absolute));&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;kmlLayer.Name = "Project Index";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_md.Map.ChildItems.Add(kmlLayer);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When this code completes, the item in the Contents list has a red exclamation point in the icon and the tool-tip "Invalid data source".&amp;nbsp; If I double-click it, the "Repair KML Network Link" dialog comes up with the URI that I added to my item.&amp;nbsp; If I click the "Repair" button, the item it "fixed" somehow.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What does this "repair" do to the KML Node?&amp;nbsp; How can I do these fixes from my code?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 21:07:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-explorer-desktop-questions/creating-a-kmllayer-not-working/m-p/234660#M1476</guid>
      <dc:creator>JonathanKillen</dc:creator>
      <dc:date>2013-06-18T21:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a KmlLayer not working?</title>
      <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/creating-a-kmllayer-not-working/m-p/234661#M1477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I realized that I left out a line of code in my previous post.&amp;nbsp; Here is a corrected sample of code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;MapDisplay _md = null;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _md = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string strMachineName = "localhost";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; KmlLayer kmlLayer = new KmlLayer(new Uri(@"http://" + strMachineName + @"/KML/Projects.kml", UriKind.Absolute));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; kmlLayer.Name = "LinkToKMLFile";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _md.Map.ChildItems.Add(kmlLayer);&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:50:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-explorer-desktop-questions/creating-a-kmllayer-not-working/m-p/234661#M1477</guid>
      <dc:creator>JonathanKillen</dc:creator>
      <dc:date>2021-12-11T11:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a KmlLayer not working?</title>
      <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/creating-a-kmllayer-not-working/m-p/234662#M1478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I contacted Support since I was not getting a response.&amp;nbsp; I learned that I needed to call "kmlLayer.Connect()" right before I add it to the Map.&amp;nbsp; I hope that helps someone else.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Aug 2013 14:09:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-explorer-desktop-questions/creating-a-kmllayer-not-working/m-p/234662#M1478</guid>
      <dc:creator>JonathanKillen</dc:creator>
      <dc:date>2013-08-08T14:09:32Z</dc:date>
    </item>
  </channel>
</rss>

