<?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 limit a mapview to a defined envelop? in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-limit-a-mapview-to-a-defined-envelop/m-p/9137#M93</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No, unfortunately it is not possible to limit the boundary of map view.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nimesh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Sep 2010 14:52:06 GMT</pubDate>
    <dc:creator>NimeshJarecha</dc:creator>
    <dc:date>2010-09-07T14:52:06Z</dc:date>
    <item>
      <title>How to limit a mapview to a defined envelop?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-limit-a-mapview-to-a-defined-envelop/m-p/9136#M92</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is it possible to limit the map view to a defined envelop so that the map cannot be panned beyond the envelop?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Sep 2010 16:54:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-limit-a-mapview-to-a-defined-envelop/m-p/9136#M92</guid>
      <dc:creator>MelvinTan</dc:creator>
      <dc:date>2010-09-06T16:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit a mapview to a defined envelop?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-limit-a-mapview-to-a-defined-envelop/m-p/9137#M93</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No, unfortunately it is not possible to limit the boundary of map view.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nimesh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Sep 2010 14:52:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-limit-a-mapview-to-a-defined-envelop/m-p/9137#M93</guid>
      <dc:creator>NimeshJarecha</dc:creator>
      <dc:date>2010-09-07T14:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit a mapview to a defined envelop?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-limit-a-mapview-to-a-defined-envelop/m-p/9138#M94</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;No, unfortunately it is not possible to limit the boundary of map view.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Nimesh&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you think that this feature or property will be implemented in the API on a final version? Because when I do zoom out on a mapView without custom envelop, the white background sees and it is some ugly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BR,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Koldo.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Sep 2010 16:40:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-limit-a-mapview-to-a-defined-envelop/m-p/9138#M94</guid>
      <dc:creator>KOLDODUARTE</dc:creator>
      <dc:date>2010-09-08T16:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit a mapview to a defined envelop?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-limit-a-mapview-to-a-defined-envelop/m-p/9139#M95</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Is it possible to limit the map view to a defined envelop so that the map cannot be panned beyond the envelop?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can home brew this functionality easily and I am using it successfully for several things I'm working on. You simply need to spin off a new thread that constantly polls the map view's current envelope to determine whether the user has zoomed out further than you like. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Although you should of course keep the number of threads running to an absolute minimum, the extent patrolling thread is not a resource hog and this is the only way to do it until ESRI implements this function within the SDK where it can run on one of their background threads.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Below is the basic code for doing this. You would presumably call startPatrollingExtent in viewDidLoad or when you want to start limiting user movement. Changing the value of the patrolling instance of the stateTrooper typedef will kill the thread and you can then reinitialize it by calling startPatrollingExtent again. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You should also prevent the user from being able to interact with the map while it is reframing so that multiple zoomToEnvelope calls are not sent, although I have not seen that cause problems or crashes. Also, setting up a few cases where the map reframes according to how the user gets out of bounds makes the reframing look a lot better. For instance, if the user does a pinch zoom and pulls out too wide, it makes sense to simply zoom back to the maximum extent. If, however, the user is zoomed in very close and drags outside of the allowed envelope, it makes more sense to pull them back to the edge than it does to zoom to the full allowed extent. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Make sure and read up on threading first if you are unfamiliar.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-(void)startPatrollingExtent; //begin limiting the extent to which the user can zoom&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; stateTrooper = patrolling;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; [NSThread detachNewThreadSelector:@selector(startPatrollingExtentThread) toTarget:self withObject:nil];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-(void)startPatrollingExtentThread;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; while (stateTrooper == patrolling)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [self performSelectorOnMainThread:@selector(checkExtent) withObject:nil waitUntilDone:YES];&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; [pool drain];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-(void)checkExtent;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; if (framer == areNotReframing) //if we are currently reframing, do nothing&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; if([patrolledExtent containsEnvelope:theImageMap.envelope]) //if we are still inside the patrolled extent, no biggie&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; else { //zoom back to patrolled extent&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; [theImageMap zoomToEnvelope:patrolledExtent animated:YES];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Sep 2010 22:17:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-limit-a-mapview-to-a-defined-envelop/m-p/9139#M95</guid>
      <dc:creator>DanaMaher</dc:creator>
      <dc:date>2010-09-15T22:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit a mapview to a defined envelop?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-limit-a-mapview-to-a-defined-envelop/m-p/9140#M96</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Bernese,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This evening, I will try it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your report!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Sep 2010 06:02:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-limit-a-mapview-to-a-defined-envelop/m-p/9140#M96</guid>
      <dc:creator>KOLDODUARTE</dc:creator>
      <dc:date>2010-09-16T06:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit a mapview to a defined envelop?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-limit-a-mapview-to-a-defined-envelop/m-p/9141#M97</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A quick update; I found that it is better to run the checking method on a timer rather than a while loop since the number of calls per unit time performed by the while loop is simply excessive. The startPatrollingExtent method looks like this with a timer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(checkExtent) userInfo:nil repeats:YES];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; while (stateTrooper == patrolling)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [[NSRunLoop currentRunLoop] run];&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; [pool drain];&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Sep 2010 20:55:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-limit-a-mapview-to-a-defined-envelop/m-p/9141#M97</guid>
      <dc:creator>DanaMaher</dc:creator>
      <dc:date>2010-09-30T20:55:04Z</dc:date>
    </item>
  </channel>
</rss>

