<?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 do we ignore the auto-zoom in CreateLayer in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-we-ignore-the-auto-zoom-in-createlayer/m-p/1196517#M8504</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/12882"&gt;@Wolf&lt;/a&gt;&amp;nbsp;thanks! I looked through the API and Samples and couldn't find a way to ignore zoom. But thanks for the code snippet as it will work for now. I was thinking about the same thing...basically take a snapshot of the extent, CreateLayer, then zoom back to saved extent.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Jul 2022 19:14:27 GMT</pubDate>
    <dc:creator>AbelPerez</dc:creator>
    <dc:date>2022-07-27T19:14:27Z</dc:date>
    <item>
      <title>How do we ignore the auto-zoom in CreateLayer</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-we-ignore-the-auto-zoom-in-createlayer/m-p/1195262#M8483</link>
      <description>&lt;P&gt;In updating my code to the Pro 3.0 SDK I see that there is now a new way to add a FeatureClass to the map. So I went through and refactored my code block to this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;//add the feature class to the map
//https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-3.0-Migration-Guide#arcgisdesktopmappingdll
var lyrParams = new FeatureLayerCreationParams(grdFeatClass) { MapMemberPosition = MapMemberPosition.AddToTop };
var featLayer = LayerFactory.Instance.CreateLayer&amp;lt;FeatureLayer&amp;gt;(lyrParams, mv.Map);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Works great but I also noticed that it ALWAYS zooms in to the layer. I have custom zooming logic that is basically NoZoom or ZoomWithPadding. I would like to just have the&amp;nbsp;CreateLayer not do any zooming at all and let me apply it -OR- not apply it.&lt;BR /&gt;&lt;BR /&gt;Anyway of doing this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jul 2022 20:36:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-we-ignore-the-auto-zoom-in-createlayer/m-p/1195262#M8483</guid>
      <dc:creator>AbelPerez</dc:creator>
      <dc:date>2022-07-24T20:36:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do we ignore the auto-zoom in CreateLayer</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-we-ignore-the-auto-zoom-in-createlayer/m-p/1196500#M8501</link>
      <description>&lt;P&gt;I couldn't find an easy way to do this.&amp;nbsp;&amp;nbsp;We did reach out to the Dev team to see if we overlooked something here, but in the meantime the following snippet resets the extent to the extent before adding the new feature layer:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;QueuedTask.Run(() =&amp;gt;
{
  var map = MapView.Active.Map;
  var flyrCreateParam = new FeatureLayerCreationParams(new Uri(@"C:\Data\Admin\AdminData.gdb\USA\cities"))
  {
    Name = "World Cities",
    IsVisible = true
  };
  var cameraBefore = MapView.Active.Camera;
  var featureLayer = LayerFactory.Instance.CreateLayer&amp;lt;FeatureLayer&amp;gt;(
    flyrCreateParam, map);
  if (cameraBefore != null)
    MapView.Active.ZoomTo(cameraBefore);
});&lt;/LI-CODE&gt;&lt;P&gt;Needless to say, this is just a work-around, once we hear back from the Dev team, I will let you know if there's a better way to accomplish your workflow.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2022 18:35:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-we-ignore-the-auto-zoom-in-createlayer/m-p/1196500#M8501</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2022-07-27T18:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do we ignore the auto-zoom in CreateLayer</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-we-ignore-the-auto-zoom-in-createlayer/m-p/1196517#M8504</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/12882"&gt;@Wolf&lt;/a&gt;&amp;nbsp;thanks! I looked through the API and Samples and couldn't find a way to ignore zoom. But thanks for the code snippet as it will work for now. I was thinking about the same thing...basically take a snapshot of the extent, CreateLayer, then zoom back to saved extent.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2022 19:14:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-we-ignore-the-auto-zoom-in-createlayer/m-p/1196517#M8504</guid>
      <dc:creator>AbelPerez</dc:creator>
      <dc:date>2022-07-27T19:14:27Z</dc:date>
    </item>
  </channel>
</rss>

