<?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 Web AppBuilder setextent not working in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/web-appbuilder-setextent-not-working/m-p/847203#M10520</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have created a small demo widget in the Developer version of WAB to add some graphics (a target grid). After completion of a task I want to display to zoom to the extent of the graphics however my attempts to reset the map extent map.setExtent fail. When I print out the coordinates of the map (map.extent) before and after they remain the same. The app spatial reference is reported as 102100 when I print it in the console and the app is using a standard Esri basemap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var testExtent = this.map.extent;&lt;/P&gt;&lt;P&gt;console.log(testExtent.xmin + "," + testExtent.ymin + "," + testExtent.xmax + "," + testExtent.ymax);&lt;/P&gt;&lt;P&gt;console.log(this.map.spatialReference);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;var sr = new SpatialReference(102100);&lt;/P&gt;&lt;P&gt;var xOrigin = targetX - 500;&lt;/P&gt;&lt;P&gt;var yOrigin = targetY - 500;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;var gridExtent = new Extent(xOrigin, yOrigin, xOrigin + 1000, yOrigin + 1000, this.map.spatialReference);&lt;/P&gt;&lt;P&gt;console.log(gridExtent.xmin + "," + gridExtent.ymin + "," + gridExtent.xmax + "," + gridExtent.ymax);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;this.map.setExtent = gridExtent.expand(1.5);&lt;/P&gt;&lt;P&gt;testExtent = this.map.extent;&lt;/P&gt;&lt;P&gt;console.log(testExtent.xmin + "," + testExtent.ymin + "," + testExtent.xmax + "," + testExtent.ymax);&lt;/P&gt;&lt;P&gt;console.log(this.map.spatialReference);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any help would be greatly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Mar 2016 13:25:11 GMT</pubDate>
    <dc:creator>DaveAdams</dc:creator>
    <dc:date>2016-03-07T13:25:11Z</dc:date>
    <item>
      <title>Web AppBuilder setextent not working</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/web-appbuilder-setextent-not-working/m-p/847203#M10520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have created a small demo widget in the Developer version of WAB to add some graphics (a target grid). After completion of a task I want to display to zoom to the extent of the graphics however my attempts to reset the map extent map.setExtent fail. When I print out the coordinates of the map (map.extent) before and after they remain the same. The app spatial reference is reported as 102100 when I print it in the console and the app is using a standard Esri basemap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var testExtent = this.map.extent;&lt;/P&gt;&lt;P&gt;console.log(testExtent.xmin + "," + testExtent.ymin + "," + testExtent.xmax + "," + testExtent.ymax);&lt;/P&gt;&lt;P&gt;console.log(this.map.spatialReference);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;var sr = new SpatialReference(102100);&lt;/P&gt;&lt;P&gt;var xOrigin = targetX - 500;&lt;/P&gt;&lt;P&gt;var yOrigin = targetY - 500;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;var gridExtent = new Extent(xOrigin, yOrigin, xOrigin + 1000, yOrigin + 1000, this.map.spatialReference);&lt;/P&gt;&lt;P&gt;console.log(gridExtent.xmin + "," + gridExtent.ymin + "," + gridExtent.xmax + "," + gridExtent.ymax);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;this.map.setExtent = gridExtent.expand(1.5);&lt;/P&gt;&lt;P&gt;testExtent = this.map.extent;&lt;/P&gt;&lt;P&gt;console.log(testExtent.xmin + "," + testExtent.ymin + "," + testExtent.xmax + "," + testExtent.ymax);&lt;/P&gt;&lt;P&gt;console.log(this.map.spatialReference);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any help would be greatly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Mar 2016 13:25:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/web-appbuilder-setextent-not-working/m-p/847203#M10520</guid>
      <dc:creator>DaveAdams</dc:creator>
      <dc:date>2016-03-07T13:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Web AppBuilder setextent not working</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/web-appbuilder-setextent-not-working/m-p/847204#M10521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dave,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; The setExtent method defined this way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this.map.setExtent(gridExtent.expand(1.5), true);&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/map-amd.html#setextent" title="https://developers.arcgis.com/javascript/jsapi/map-amd.html#setextent"&gt;Map | API Reference | ArcGIS API for JavaScript | setExtent&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Mar 2016 14:34:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/web-appbuilder-setextent-not-working/m-p/847204#M10521</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-03-07T14:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: Web AppBuilder setextent not working</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/web-appbuilder-setextent-not-working/m-p/847205#M10522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks Robert - I'd spent so long looking at the coordinates and spatial references I had missed the obvious error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Mar 2016 14:40:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/web-appbuilder-setextent-not-working/m-p/847205#M10522</guid>
      <dc:creator>DaveAdams</dc:creator>
      <dc:date>2016-03-07T14:40:10Z</dc:date>
    </item>
  </channel>
</rss>

