<?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 [ArcEngine] Prevent ArcObjects from changing the view extent when adding a map layer in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcengine-prevent-arcobjects-from-changing-the/m-p/115479#M3029</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Greetings,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The custom application I am using relies on the OnExtentUpdated() event, which is called by ArcObjects whenever the map extent is updated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There seems no way to specify that this callback should only be triggered from actual user actions (i.e. pan and zoom) - and NOT when adding a map layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A simple workaround would be to simply set a flag when adding a map layer and consequently not to handle the update event when it is triggered - but this has it's drawbacks : &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) I cannot guarantee that the flag will not accidentally ignore a user operation (for instance if a map is being added at the same time during runtime).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) More importantly, map objects still sets the Extent object itself - which would require me to override the extent again - but that in turn would trigger the ExtentUpdated callback. Far too messy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The only alternative I can see at the moment : Ignore the ExtentUpdated event completely, manually intercept all user pan and zoom operations, and keep track of the map extent explicitly (i.e. ignore the ArcObjects extent, and only set it when it is required to set the extent programmatically).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Please tell me there is a better way to gain more control over the map extent?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Apr 2012 15:32:45 GMT</pubDate>
    <dc:creator>ManfredLauterbach</dc:creator>
    <dc:date>2012-04-13T15:32:45Z</dc:date>
    <item>
      <title>[ArcEngine] Prevent ArcObjects from changing the view extent when adding a map layer</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcengine-prevent-arcobjects-from-changing-the/m-p/115479#M3029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Greetings,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The custom application I am using relies on the OnExtentUpdated() event, which is called by ArcObjects whenever the map extent is updated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There seems no way to specify that this callback should only be triggered from actual user actions (i.e. pan and zoom) - and NOT when adding a map layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A simple workaround would be to simply set a flag when adding a map layer and consequently not to handle the update event when it is triggered - but this has it's drawbacks : &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) I cannot guarantee that the flag will not accidentally ignore a user operation (for instance if a map is being added at the same time during runtime).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) More importantly, map objects still sets the Extent object itself - which would require me to override the extent again - but that in turn would trigger the ExtentUpdated callback. Far too messy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The only alternative I can see at the moment : Ignore the ExtentUpdated event completely, manually intercept all user pan and zoom operations, and keep track of the map extent explicitly (i.e. ignore the ArcObjects extent, and only set it when it is required to set the extent programmatically).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Please tell me there is a better way to gain more control over the map extent?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Apr 2012 15:32:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcengine-prevent-arcobjects-from-changing-the/m-p/115479#M3029</guid>
      <dc:creator>ManfredLauterbach</dc:creator>
      <dc:date>2012-04-13T15:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: [ArcEngine] Prevent ArcObjects from changing the view extent when adding a map la</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcengine-prevent-arcobjects-from-changing-the/m-p/115480#M3030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Still can't find a solution for this one - even if we detect that the extent was changed, it still causes serious display issues to refresh twice (set the extent back to what it was) when there are large amounts of data involved.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please tell me there is a way to prevent arc objects from changing the extent when layers are added?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2012 13:37:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcengine-prevent-arcobjects-from-changing-the/m-p/115480#M3030</guid>
      <dc:creator>ManfredLauterbach</dc:creator>
      <dc:date>2012-04-26T13:37:02Z</dc:date>
    </item>
    <item>
      <title>workaround</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcengine-prevent-arcobjects-from-changing-the/m-p/115481#M3031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There seems to be no other way to avoid this problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As an undesirable alternative, one can also maintain one's own extent history. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Every time OnExtentUpdated is called, check whether the extent has really changed. If the extent coordinates have not changed (i.e. when a layer is added), then ignore the event.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jul 2012 11:50:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcengine-prevent-arcobjects-from-changing-the/m-p/115481#M3031</guid>
      <dc:creator>ManfredLauterbach</dc:creator>
      <dc:date>2012-07-13T11:50:57Z</dc:date>
    </item>
  </channel>
</rss>

