<?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 Shape File shows in TOC but not on map in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/shape-file-shows-in-toc-but-not-on-map/m-p/452548#M12292</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I currently have an ArcToc Control and an ArcMap Control.&amp;nbsp; Where I'm attempting to create a shapefile , have it saved (to disk) , display on the Table-Of-Contents and also on the Map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Currently, the Line/Polyline/Polygon/Ellipse all are created as proper shape files. They are also added to my TOC Control and show the name - the linestyle and I can properly view the properties (thickness/color/etc).&amp;nbsp; However, they do not show up on the map initially.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I go to the TOC and change the line thickness from the default (1) to any higher number it shows.If I change the line style from solid to Dashes , zoom in and zoom out it also shows.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any idea why this is happening?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Jun 2012 15:37:13 GMT</pubDate>
    <dc:creator>BryanKardisco</dc:creator>
    <dc:date>2012-06-15T15:37:13Z</dc:date>
    <item>
      <title>Shape File shows in TOC but not on map</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/shape-file-shows-in-toc-but-not-on-map/m-p/452548#M12292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I currently have an ArcToc Control and an ArcMap Control.&amp;nbsp; Where I'm attempting to create a shapefile , have it saved (to disk) , display on the Table-Of-Contents and also on the Map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Currently, the Line/Polyline/Polygon/Ellipse all are created as proper shape files. They are also added to my TOC Control and show the name - the linestyle and I can properly view the properties (thickness/color/etc).&amp;nbsp; However, they do not show up on the map initially.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I go to the TOC and change the line thickness from the default (1) to any higher number it shows.If I change the line style from solid to Dashes , zoom in and zoom out it also shows.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any idea why this is happening?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jun 2012 15:37:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/shape-file-shows-in-toc-but-not-on-map/m-p/452548#M12292</guid>
      <dc:creator>BryanKardisco</dc:creator>
      <dc:date>2012-06-15T15:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Shape File shows in TOC but not on map</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/shape-file-shows-in-toc-but-not-on-map/m-p/452549#M12293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try invalidating the &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/Invalidate_Method/002m0000038n000000/" rel="nofollow" target="_blank"&gt;spatial index&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is another doc that goes into more detail on &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/d/000100000197000000.htm" rel="nofollow" target="_blank"&gt;working with indexes&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2012 16:39:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/shape-file-shows-in-toc-but-not-on-map/m-p/452549#M12293</guid>
      <dc:creator>JohnHauck</dc:creator>
      <dc:date>2012-06-20T16:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: Shape File shows in TOC but not on map</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/shape-file-shows-in-toc-but-not-on-map/m-p/452550#M12294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Try invalidating the &lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/Invalidate_Method/002m0000038n000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;spatial index&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;Here is another doc that goes into more detail on &lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/d/000100000197000000.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;working with indexes&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've tried invalidating the spatial index by doing the following: your suggestion in bold&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;IPolygon poly = (IPolygon)myAxMap.TrackPolygon();
poly.SpatialReference = mySpatialReference;

IPointCollection p = poly as IPointCollection;

IGeometry geometry = p as IGeometry;
geometry.SpatialReference = mySpatialReference;
((IZaware)geometry).ZAware = false;

string shapeFileURL = CreateShapeFile(p , LayerName); //Where this generates a valid shp file and returns the full file path
AddLayer(shapeFileURL); //Where this creates the ILayer , sets the layer effects and adds it to a group in myTocControl 

&lt;STRONG&gt;((ISpatialIndex)poly).Invaldiate();&lt;/STRONG&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Like I said, the layer shows up in the TOC Control (In the proper spot for indexing).&amp;nbsp; If I close the app I can see the valid ShapeFile.&amp;nbsp; I've inspected it manually and with the existing ESRI Tools that can be used to look at layers and the like and it's all good.&amp;nbsp; If I re-open the app it's visible and the indexing is still the same .&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any other ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:11:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/shape-file-shows-in-toc-but-not-on-map/m-p/452550#M12294</guid>
      <dc:creator>BryanKardisco</dc:creator>
      <dc:date>2021-12-11T20:11:13Z</dc:date>
    </item>
  </channel>
</rss>

