<?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: move only inside of a specific extent in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/move-only-inside-of-a-specific-extent/m-p/277646#M25625</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Thank you for the response, I have done what you have suggested with this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;app.map.on("extent-change",&amp;nbsp; function()&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;var geo = app.map.extent;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Calibri',sans-serif;"&gt;if (((geo.xmin) &amp;lt; (initialExtent.xmin - 100)) || ((geo.xmax) &amp;gt; (initialExtent.xmax + 100)) || ((geo.ymax) &amp;gt; (initialExtent.ymax + 100)) || ((geo.ymin) &amp;lt; (initialExtent.ymin - 100))){&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Calibri',sans-serif;"&gt;app.map.setExtent(initialExtent)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Calibri',sans-serif;"&gt;}})&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Calibri',sans-serif;"&gt;No matter how many different version of how to write it, all the times I have tried it the code worked, but about 50% of the time in chrome (in Firefox more than that), after some paning and zooming with the map it got stuck inside of re- centring the map.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Calibri',sans-serif;"&gt;Any idea?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Calibri',sans-serif;"&gt;Thank You,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Calibri',sans-serif;"&gt;Roi.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 May 2015 14:13:06 GMT</pubDate>
    <dc:creator>roialgavish</dc:creator>
    <dc:date>2015-05-01T14:13:06Z</dc:date>
    <item>
      <title>move only inside of a specific extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/move-only-inside-of-a-specific-extent/m-p/277644#M25623</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;I am looking for an idea about how to define the map so the users can only move inside of a specific extent. I want the users to be able to pan, scroll and generally move inside the box, but I don’t want them to move outside of the box.&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you Roi Algavish. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2015 13:30:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/move-only-inside-of-a-specific-extent/m-p/277644#M25623</guid>
      <dc:creator>roialgavish</dc:creator>
      <dc:date>2015-04-27T13:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: move only inside of a specific extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/move-only-inside-of-a-specific-extent/m-p/277645#M25624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Roi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maybe you could use the extent-change event to check if the user is still in the extent you want them too and once they go outside your extent you can call a function that moves them back into the extent?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/map.html#event-extent-change" title="https://developers.arcgis.com/javascript/jsapi/map.html#event-extent-change"&gt;Map | API Reference | ArcGIS API for JavaScript&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2015 13:35:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/move-only-inside-of-a-specific-extent/m-p/277645#M25624</guid>
      <dc:creator>TimWitt2</dc:creator>
      <dc:date>2015-04-27T13:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: move only inside of a specific extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/move-only-inside-of-a-specific-extent/m-p/277646#M25625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Thank you for the response, I have done what you have suggested with this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;app.map.on("extent-change",&amp;nbsp; function()&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;var geo = app.map.extent;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Calibri',sans-serif;"&gt;if (((geo.xmin) &amp;lt; (initialExtent.xmin - 100)) || ((geo.xmax) &amp;gt; (initialExtent.xmax + 100)) || ((geo.ymax) &amp;gt; (initialExtent.ymax + 100)) || ((geo.ymin) &amp;lt; (initialExtent.ymin - 100))){&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Calibri',sans-serif;"&gt;app.map.setExtent(initialExtent)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Calibri',sans-serif;"&gt;}})&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Calibri',sans-serif;"&gt;No matter how many different version of how to write it, all the times I have tried it the code worked, but about 50% of the time in chrome (in Firefox more than that), after some paning and zooming with the map it got stuck inside of re- centring the map.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Calibri',sans-serif;"&gt;Any idea?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Calibri',sans-serif;"&gt;Thank You,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Calibri',sans-serif;"&gt;Roi.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 May 2015 14:13:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/move-only-inside-of-a-specific-extent/m-p/277646#M25625</guid>
      <dc:creator>roialgavish</dc:creator>
      <dc:date>2015-05-01T14:13:06Z</dc:date>
    </item>
  </channel>
</rss>

