<?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 Can't create new Polyline in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/can-t-create-new-polyline/m-p/1225084#M5595</link>
    <description>&lt;P&gt;I can't create a new Polyline Geomtery Object in Experience Builder 1.5. If I use the code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;new polyline({..})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my widget will not be loaded any more (fail to load):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import Polyline from 'esri/geometry/Polyline';

zoomTo = (geom: IGeometry) =&amp;gt; {
    if (this.jimuMapView) {
      const pl = new 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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Oct 2022 09:03:12 GMT</pubDate>
    <dc:creator>Zoggo</dc:creator>
    <dc:date>2022-10-25T09:03:12Z</dc:date>
    <item>
      <title>Can't create new Polyline</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/can-t-create-new-polyline/m-p/1225084#M5595</link>
      <description>&lt;P&gt;I can't create a new Polyline Geomtery Object in Experience Builder 1.5. If I use the code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;new polyline({..})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my widget will not be loaded any more (fail to load):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import Polyline from 'esri/geometry/Polyline';

zoomTo = (geom: IGeometry) =&amp;gt; {
    if (this.jimuMapView) {
      const pl = new 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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 09:03:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/can-t-create-new-polyline/m-p/1225084#M5595</guid>
      <dc:creator>Zoggo</dc:creator>
      <dc:date>2022-10-25T09:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: Can't create new Polyline</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/can-t-create-new-polyline/m-p/1225102#M5597</link>
      <description>&lt;P&gt;It seems to be a Import problem. if I use&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;import Polyline from 'esri/geometry/Polyline';&lt;/PRE&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;PRE&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;/PRE&gt;&lt;P&gt;I can use the Polygon type like this&lt;/P&gt;&lt;PRE&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;/PRE&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:51:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/can-t-create-new-polyline/m-p/1225102#M5597</guid>
      <dc:creator>Zoggo</dc:creator>
      <dc:date>2022-10-25T10:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: Can't create new Polyline</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/can-t-create-new-polyline/m-p/1225156#M5600</link>
      <description>&lt;P&gt;This is the &lt;A href="https://community.esri.com/t5/arcgis-experience-builder-questions/zoom-to-igeometry-object/m-p/1225111/highlight/true#M5598" target="_self"&gt;solution&lt;/A&gt;:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try adding&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/experience-builder/api-reference/jimu-core/WidgetManifest#dependency" target="_blank" rel="noopener nofollow noreferrer"&gt;this&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to your manifest.json:&lt;/P&gt;&lt;PRE&gt; "dependency": [
    "jimu-arcgis"
  ]&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Oct 2022 13:08:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/can-t-create-new-polyline/m-p/1225156#M5600</guid>
      <dc:creator>Zoggo</dc:creator>
      <dc:date>2022-10-25T13:08:44Z</dc:date>
    </item>
  </channel>
</rss>

