<?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: Zoom to IGeometry Object in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/zoom-to-igeometry-object/m-p/1225074#M5594</link>
    <description>&lt;P&gt;I can't use&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import Geometry from 'esri/geometry/Geometry';&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Module '"esri/geometry/Geometry"' can only be default-imported using the 'allowSyntheticDefaultImports' flagts(1259)
arcgis-js-api.d.ts(95049, 3): This module is declared with 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.&lt;/LI-CODE&gt;&lt;P&gt;I use&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import { Polygon,Polyline, Geometry } from 'esri/geometry';&lt;/LI-CODE&gt;&lt;P&gt;instead. Could this be a problem?&lt;BR /&gt;&lt;BR /&gt;I can cast to geom as Geometry but the Object shows still the same content:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;geom
{spatialReference: {…}, paths: Array(1)}
paths : [Array(153)]
spatialReference : {latestWkid: 2056, wkid: 2056}
[[Prototype]]: Object&lt;/LI-CODE&gt;&lt;P&gt;It doesn't look like a Geometry Object.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Therefore still no zoom/pan to the Geometry...&lt;/P&gt;</description>
    <pubDate>Tue, 25 Oct 2022 08:32:46 GMT</pubDate>
    <dc:creator>Zoggo</dc:creator>
    <dc:date>2022-10-25T08:32:46Z</dc:date>
    <item>
      <title>Zoom to IGeometry Object</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/zoom-to-igeometry-object/m-p/1224840#M5592</link>
      <description>&lt;P&gt;I cant zoom/pan to a IGeometry Object from a FeatureDataRecord. I'm using following function for this.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;  zoomTo = (geom: IGeometry) =&amp;gt; {
    if (this.jimuMapView) {
      this.jimuMapView.view.goTo(geom).catch(function (error) {
        if (error.name != "AbortError") {
          console.error(error);
        }
      });
    }
  }&lt;/LI-CODE&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;There's no error but the view doesn't move to the Geometry...&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 24 Oct 2022 19:28:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/zoom-to-igeometry-object/m-p/1224840#M5592</guid>
      <dc:creator>Zoggo</dc:creator>
      <dc:date>2022-10-24T19:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to IGeometry Object</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/zoom-to-igeometry-object/m-p/1224866#M5593</link>
      <description>&lt;P&gt;Try casting as Geometry&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import Geometry from 'esri/geometry/Geometry';

this.jimuMapView?.view.goTo(geom as Geometry);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 20:32:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/zoom-to-igeometry-object/m-p/1224866#M5593</guid>
      <dc:creator>DougLogsdon2</dc:creator>
      <dc:date>2022-10-24T20:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to IGeometry Object</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/zoom-to-igeometry-object/m-p/1225074#M5594</link>
      <description>&lt;P&gt;I can't use&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import Geometry from 'esri/geometry/Geometry';&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Module '"esri/geometry/Geometry"' can only be default-imported using the 'allowSyntheticDefaultImports' flagts(1259)
arcgis-js-api.d.ts(95049, 3): This module is declared with 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.&lt;/LI-CODE&gt;&lt;P&gt;I use&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import { Polygon,Polyline, Geometry } from 'esri/geometry';&lt;/LI-CODE&gt;&lt;P&gt;instead. Could this be a problem?&lt;BR /&gt;&lt;BR /&gt;I can cast to geom as Geometry but the Object shows still the same content:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;geom
{spatialReference: {…}, paths: Array(1)}
paths : [Array(153)]
spatialReference : {latestWkid: 2056, wkid: 2056}
[[Prototype]]: Object&lt;/LI-CODE&gt;&lt;P&gt;It doesn't look like a Geometry Object.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Therefore still no zoom/pan to the Geometry...&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 08:32:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/zoom-to-igeometry-object/m-p/1225074#M5594</guid>
      <dc:creator>Zoggo</dc:creator>
      <dc:date>2022-10-25T08:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to IGeometry Object</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/zoom-to-igeometry-object/m-p/1225101#M5596</link>
      <description>&lt;P&gt;It seems to be a Import problem. if I use&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;import Polyline from 'esri/geometry/Polyline';&lt;/LI-CODE&gt;&lt;P&gt;the widget can't load when I use new Polygon({..}).&lt;BR /&gt;&lt;BR /&gt;if I use use&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;constructor(props) {
    super(props);
    loadArcGISJSAPIModules([
      "esri/geometry/geometryEngine",
      "esri/geometry/Polyline"
    ]).then((modules) =&amp;gt; {
      [this.geometryEngine, this.polyline] = modules;
      console.log("ESRI API Moduls loaded");
    });
  }&lt;/LI-CODE&gt;&lt;P&gt;I can use the Polygon type like this&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;zoomTo = (geom: IGeometry) =&amp;gt; {
    if (this.jimuMapView) {
      const pl = new this.polyline({
        paths: (geom as IPolyline).paths,
        spatialReference: geom.spatialReference
        
      });
      this.jimuMapView.view.goTo(pl).catch(function (error) {
        if (error.name != "AbortError") {
          console.error(error);
        }
      });
    }
  }&lt;/LI-CODE&gt;&lt;P&gt;But I don't understand why I can't use import?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 10:50:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/zoom-to-igeometry-object/m-p/1225101#M5596</guid>
      <dc:creator>Zoggo</dc:creator>
      <dc:date>2022-10-25T10:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to IGeometry Object</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/zoom-to-igeometry-object/m-p/1225111#M5598</link>
      <description>&lt;P&gt;Try adding &lt;A href="https://developers.arcgis.com/experience-builder/api-reference/jimu-core/WidgetManifest#dependency" target="_blank" rel="noopener"&gt;this&lt;/A&gt; to your manifest.json:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; "dependency": [
    "jimu-arcgis"
  ]&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 25 Oct 2022 11:24:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/zoom-to-igeometry-object/m-p/1225111#M5598</guid>
      <dc:creator>DougLogsdon2</dc:creator>
      <dc:date>2022-10-25T11:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to IGeometry Object</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/zoom-to-igeometry-object/m-p/1225155#M5599</link>
      <description>&lt;P&gt;That's solved my problems. Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 13:04:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/zoom-to-igeometry-object/m-p/1225155#M5599</guid>
      <dc:creator>Zoggo</dc:creator>
      <dc:date>2022-10-25T13:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to IGeometry Object</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/zoom-to-igeometry-object/m-p/1287163#M6884</link>
      <description>&lt;P&gt;I have updated ExB from Version 1.5 to 1.11 and again I get stuck with this problem. This code isn't working any more for me:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;zoomTo = (geom: IGeometry) =&amp;gt; {
    let g;
    if ((geom as IPolyline).paths) {
      g = new Polyline(geom);
    } else {
      g = new Polygon(geom);
    }
    this.jimuMapView?.view.goTo(g).catch(function (error) {
      // if (error.name != "AbortError") {
      //   console.error(error);
      // }
    });
  }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;new Polyline or new Polygone won't be found&lt;/P&gt;&lt;P&gt;I still have this in my manifest.json:&lt;/P&gt;&lt;PRE&gt; "dependency": [
    "jimu-arcgis"
  ]&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 09:03:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/zoom-to-igeometry-object/m-p/1287163#M6884</guid>
      <dc:creator>Zoggo</dc:creator>
      <dc:date>2023-05-09T09:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to IGeometry Object</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/zoom-to-igeometry-object/m-p/1287167#M6885</link>
      <description>&lt;P&gt;I just solved this. I hade to change the Import part from&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import { Polyline, Polygon } from "esri/geometry";&lt;/LI-CODE&gt;&lt;P&gt;to&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import Polyline from "esri/geometry/Polyline";
import Polygon from "esri/geometry/Polygon";&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 09 May 2023 09:10:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/zoom-to-igeometry-object/m-p/1287167#M6885</guid>
      <dc:creator>Zoggo</dc:creator>
      <dc:date>2023-05-09T09:10:34Z</dc:date>
    </item>
  </channel>
</rss>

