<?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: Constrain Behavior feature in WAB in ArcGIS Web AppBuilder Questions</title>
    <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/constrain-behavior-feature-in-wab/m-p/301730#M8015</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;good afternoon.&amp;nbsp; when I got time I went back to the code and put check points to see whether the person assigned was a state user (only for state users the extent needs to be locked like Silverlight app), I used to code to zoom to a state.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case, there is a user who can access only MS - your neighboring state.&amp;nbsp; I was able to check and zoom to MS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Locking the extent or preventing the zoom out&amp;nbsp; became a problem:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;onExtentChange: function()
{
if&amp;nbsp; (ZR_STATE_EXENT_OBJ) 
{
var deltaXmin = this.map.extent.xmin - ZR_STATE_EXTENT+OBJ.xmin ; //should b positive - otherwise restrict or don't zoom out
var deltaYmin = ... ; //should be positive;

var deltaXmax = .... ; // should be negative or otherwise prevent extent change 
var deltaYmax = ...;

if(deltaXmin &amp;lt; 0 || deltaYmin &amp;lt;0 || deltaXmax &amp;gt; 0 || deltaYmax &amp;gt;0)
{
this.map.setExtent(ZR_STATE_EXTENT_OBJ);
}

}



}&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The if condition gets triggered even if I zoom in by clicking the plus sign to zoom in... which should not be the case.case.&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 14:28:33 GMT</pubDate>
    <dc:creator>Ravichandran_M_Kaushika</dc:creator>
    <dc:date>2021-12-11T14:28:33Z</dc:date>
    <item>
      <title>Constrain Behavior feature in WAB</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/constrain-behavior-feature-in-wab/m-p/301727#M8012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In Silverlight, there was a feature:&lt;/P&gt;&lt;P&gt;&amp;lt;esriBehaviors: ConstrainExtentBehavior ConstrainedExtent= "minx, miny, maxx, maxy" /&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there an equivalent in the JS or WAB version of the same feature.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;ravi Kaushika.&lt;/P&gt;&lt;PRE __default_attr="xml" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14653360931007812" data-renderedposition="264_50_798_0" jivemacro_uid="_14653360931007812"&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2016 21:51:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/constrain-behavior-feature-in-wab/m-p/301727#M8012</guid>
      <dc:creator>Ravichandran_M_Kaushika</dc:creator>
      <dc:date>2016-06-07T21:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: Constrain Behavior feature in WAB</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/constrain-behavior-feature-in-wab/m-p/301728#M8013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; You will find that there was not a great deal of consistency across the web API back in the day. No there is no such method or component in the JS API. I do not have any code examples but the best you could do is watch the maps extent change event and if it would extend beyond the desired extent then you would reset the extent to one that is desired.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2016 12:54:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/constrain-behavior-feature-in-wab/m-p/301728#M8013</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-06-08T12:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: Constrain Behavior feature in WAB</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/constrain-behavior-feature-in-wab/m-p/301729#M8014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks a bunch for your prompt reply.&amp;nbsp; you are very helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;ravi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2016 18:13:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/constrain-behavior-feature-in-wab/m-p/301729#M8014</guid>
      <dc:creator>Ravichandran_M_Kaushika</dc:creator>
      <dc:date>2016-06-08T18:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: Constrain Behavior feature in WAB</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/constrain-behavior-feature-in-wab/m-p/301730#M8015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;good afternoon.&amp;nbsp; when I got time I went back to the code and put check points to see whether the person assigned was a state user (only for state users the extent needs to be locked like Silverlight app), I used to code to zoom to a state.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case, there is a user who can access only MS - your neighboring state.&amp;nbsp; I was able to check and zoom to MS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Locking the extent or preventing the zoom out&amp;nbsp; became a problem:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;onExtentChange: function()
{
if&amp;nbsp; (ZR_STATE_EXENT_OBJ) 
{
var deltaXmin = this.map.extent.xmin - ZR_STATE_EXTENT+OBJ.xmin ; //should b positive - otherwise restrict or don't zoom out
var deltaYmin = ... ; //should be positive;

var deltaXmax = .... ; // should be negative or otherwise prevent extent change 
var deltaYmax = ...;

if(deltaXmin &amp;lt; 0 || deltaYmin &amp;lt;0 || deltaXmax &amp;gt; 0 || deltaYmax &amp;gt;0)
{
this.map.setExtent(ZR_STATE_EXTENT_OBJ);
}

}



}&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The if condition gets triggered even if I zoom in by clicking the plus sign to zoom in... which should not be the case.case.&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:28:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/constrain-behavior-feature-in-wab/m-p/301730#M8015</guid>
      <dc:creator>Ravichandran_M_Kaushika</dc:creator>
      <dc:date>2021-12-11T14:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: Constrain Behavior feature in WAB</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/constrain-behavior-feature-in-wab/m-p/301731#M8016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sorry forgot to tell you: I checked the permissions and set the extent in MapManager.js file at the highest level of /widgets folder and /widgets/homebutton/widgets.js onExtentChange and setting the initialExtent using the state level extent obj set in the MapManager.js file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your support n regards&lt;/P&gt;&lt;P&gt;ravi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2016 22:53:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/constrain-behavior-feature-in-wab/m-p/301731#M8016</guid>
      <dc:creator>Ravichandran_M_Kaushika</dc:creator>
      <dc:date>2016-06-27T22:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: Constrain Behavior feature in WAB</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/constrain-behavior-feature-in-wab/m-p/301732#M8017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; In you extent change function check for the extents center (point) an if it has not changed from the last extent center (that you will need to store) then it is a zoom in or out and not a pan or a zoom and re-center and if this is the case then you can bail out of your function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jul 2016 13:10:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/constrain-behavior-feature-in-wab/m-p/301732#M8017</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-07-06T13:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: Constrain Behavior feature in WAB</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/constrain-behavior-feature-in-wab/m-p/301733#M8018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the info; sorry for the delay in replying. I was out of office.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;ravi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2016 18:22:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/constrain-behavior-feature-in-wab/m-p/301733#M8018</guid>
      <dc:creator>Ravichandran_M_Kaushika</dc:creator>
      <dc:date>2016-07-12T18:22:35Z</dc:date>
    </item>
  </channel>
</rss>

