<?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 Re: How to save a custom layer in ArcMap to mxd? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-save-a-custom-layer-in-arcmap-to-mxd/m-p/175437#M4551</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After a while I noticed that the mxd doctor is showing the right guid for my layer saved in the mxd files, but he couldn't resolve which type this guid belongs to. The solution is to ensure that the class will be com registered via esriregasm (which in my case already happened with that project) and that the needed classes have a an explicitly defined default constructor which can be used by the registration process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my class only had "specialized" constructors with parameters, but no explicitly defined default constructor without parameters. After adding this everything worked. ArcMap can now resolve which type the saved guid belongs to and rebuild the layer (in it's save/load method one has to ensure that all needed information are persisted and the building up happens in the right way).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Jul 2017 10:41:40 GMT</pubDate>
    <dc:creator>deleted-user-OFT1wBX1CgU4</dc:creator>
    <dc:date>2017-07-13T10:41:40Z</dc:date>
    <item>
      <title>How to save a custom layer in ArcMap to mxd?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-save-a-custom-layer-in-arcmap-to-mxd/m-p/175436#M4550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to be clear from the beginning: I'm not loooking for saving a custom layer to a layer file (for that I found many examples), but I want to get my custom layers saved to the mxd-files so that this layers would be displayed if the user reopens the file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using as underlying library &lt;A href="https://github.com/ArcBruTile/ArcBruTile"&gt;ArcBrutile &lt;/A&gt;and I'm displaying HERE-Maps. I found &lt;A href="http://edndoc.esri.com/arcobjects/9.1/ExtendingArcObjects/Ch04/AboutCustomLayers.htm"&gt;this (old) article about layers&lt;/A&gt; and nearly the &lt;A href="https://desktop.arcgis.com/en/arcobjects/latest/java/2c1e8131-3ca1-11dc-9d01-ed03847c0665.htm"&gt;same article for a current ArcGIS version for Java&lt;/A&gt;. The first one states that I need for saving to implement the "IPersistStream"-Interface, while the other one tells me that I need "IPersistVariant"-Interface. Originally the "IPersistVariant"-interface already was implemented for the layers. I tried to implement also the "IPersistStream"-Interface, but the layers still won't be saved to the mxd-file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So how I'm able to save tiled custom layers to mxd?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jul 2017 09:32:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-save-a-custom-layer-in-arcmap-to-mxd/m-p/175436#M4550</guid>
      <dc:creator>deleted-user-OFT1wBX1CgU4</dc:creator>
      <dc:date>2017-07-06T09:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to save a custom layer in ArcMap to mxd?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-save-a-custom-layer-in-arcmap-to-mxd/m-p/175437#M4551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After a while I noticed that the mxd doctor is showing the right guid for my layer saved in the mxd files, but he couldn't resolve which type this guid belongs to. The solution is to ensure that the class will be com registered via esriregasm (which in my case already happened with that project) and that the needed classes have a an explicitly defined default constructor which can be used by the registration process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my class only had "specialized" constructors with parameters, but no explicitly defined default constructor without parameters. After adding this everything worked. ArcMap can now resolve which type the saved guid belongs to and rebuild the layer (in it's save/load method one has to ensure that all needed information are persisted and the building up happens in the right way).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jul 2017 10:41:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-save-a-custom-layer-in-arcmap-to-mxd/m-p/175437#M4551</guid>
      <dc:creator>deleted-user-OFT1wBX1CgU4</dc:creator>
      <dc:date>2017-07-13T10:41:40Z</dc:date>
    </item>
  </channel>
</rss>

