Custom widget built in EB1.8 not working in EB1.9

368
4
08-17-2022 04:07 PM
Labels (1)
saraswathiemani2
New Contributor III

HI,

I have a custom widget built in EB 1.8. It selects points and zoom to the selection. It was successfully running in EB 1.8.

I have recently upgraded to EB 1.9, client and server from cmd, successfully starts the widget.

In 1.9, it selects the features, but does not zoom to that location.

to zoom: 

const extent = geometryEngine.union(sectionGeometries).extent;
    this.mapView?.goTo(extent);
 
The above JS API reference (goto) is used. But, I suppose its not importing the engine and sectiongeometries variable which saves the section polygons is not storing the object.
 
The same code works in 1.8
 
import geometryEngine from 'esri/geometry/geometryEngine';
import Polygon from 'esri/geometry/Polygon';
import Graphic from 'esri/Graphic';
 
the above three modules are greyed out. 
 
npm v 8.11.0
 
node v16.16.0
 
 private sectionHighlightSymbol, the vriable is also greyed out. Should i declare the variable differently? I wen through the breaking changes list,
 https://developers.arcgis.com/experience-builder/guide/whats-new/#breaking-changes
I don't find any changes for methods used in my widget. 

Any help is greatly appreciated.

0 Kudos
4 Replies
Junshan_Liu
Occasional Contributor

The modules are greyed out, do you mean the modules are not used? If it's the case, it's very strange because you use the "geometryEngine" but your editor says you don't use it, is this what you see?

0 Kudos
saraswathiemani2
New Contributor III

yes, I am using the modules. It does not give this issue in 1.8 v, the same code no changes, but in 1.9 it does not run the functions with these modules and seems to grey out the modules.

0 Kudos
saraswathiemani2
New Contributor III

Hi, Further looking at the code, I saw I have commented the code at the bottom, now when uncommented the modules are not greyed out. But, the code draws a polygon with Javascript API reference modules. In 1.8 the function is able to render the polygon, but not in 1.9. Is there anything more to the upgrade to reference the latest JavaScript API?

0 Kudos
Junshan_Liu
Occasional Contributor

1.9 uses 4.24 API, can you check the release notes: https://developers.arcgis.com/javascript/latest/release-notes/?

0 Kudos