Select to view content in your preferred language

Bookmarks Widget Fails Adding Bookmark

1671
6
09-24-2020 11:18 AM
LoranHayden1
Emerging Contributor

I am developing a  simple application using 4.16 - quite a bit different from the old 3.x stuff, so I'm still getting used to it. The additional libs/etc. I am using are bootstrap, jQuery & jQueryUI.

What I am trying to do is have a simple map displayed in a bootstrap grid using the first 11 columns and a series of buttons in the remaining column each of which will open another widget, each in its own jQueryUI dialog.

I have successfully, to an extent, (pun fully intended) managed to bring in basemap gallery, Sketch and Measure widgets (the Measure widget can be finicky, more on this later) and so I thought I'd try Bookmarks.

It successfully load the widget into the dialog and displays it but when I try to add the first bookmark the app displays a never ending whirlygig icon with the message "Adding bookmark." adjacent to it. 

And checking the developer tools displays the error:

Uncaught (in promise) TypeError: can't access property "add", b.viewModel.bookmarks is undefined
_addBookmarkSubmit https://js.arcgis.com/4.16/esri/widgets/Bookmarks.js:27

This happens every time without fail in both firefox developer edition and chrome

 (latest versions of each). 

I have also experienced the same sort of error using the Measurement widget but that is intermittent and shows up usually after having done several successful measure actions. 

Presently I am using only a single html page for the application just to keep things simple. The environment is Visual Studio Community Edition 2019. I've attached the code for anyone to have a look at.

Any suggestions would be helpful!

Tags (3)
0 Kudos
6 Replies
AnneFitz
Esri Regular Contributor

Hi Loran,

This was a bug on our side that will be fixed in the 4.17 release. Currently, adding bookmarks only works when you use the bookmarks widget with a WebMap (and not with Map). See related issue Bookmarks widget - v4.16 

We will be releasing 4.17 shortly, so stay tuned for when it's released and the bug should be fixed. Or if you want to try out the fix in our development version of 4.17, you can use https://js.arcgis.com/next in your app instead of https://js.arcgis.com/4.16.

LoranHayden1
Emerging Contributor

Seems to fix the bookmark issue but the measure tools still have trouble. 

0 Kudos
LoranHayden1
Emerging Contributor

Try using the measure tool with the same code above and after doing an area mesurement, then a length measurement, then trying another area measurement

Uncaught TypeError: can't access property "measurement", a is null
_updateGraphics https://js.arcgis.com/4.17/esri/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js:20
_updateSketch https://js.arcgis.com/4.17/esri/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js:19
_startSketch https://js.arcgis.com/4.17/esri/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js:17
emit https://js.arcgis.com/next:549
emit https://js.arcgis.com/next:549
emit https://js.arcgis.com/next:552
_updateCursor https://js.arcgis.com/4.17/esri/widgets/Sketch.js:396
_addViewHandles https://js.arcgis.com/4.17/esri/widgets/Sketch.js:389
c https://js.arcgis.com/next:1948
_handleEvent https://js.arcgis.com/next:1939
onInstall https://js.arcgis.com/next:1935
_doNewPropagation https://js.arcgis.com/next:1923
_emitInputEvent https://js.arcgis.com/next:1922
_emitInputEventFromSource https://js.arcgis.com/next:1921
_onEventReceived https://js.arcgis.com/next:1917
_handlePointerPreventDefault https://js.arcgis.com/4.17/esri/views/MapView.js:319

and then the application becomes unresponsive.

0 Kudos
LoranHayden1
Emerging Contributor

I'm kind of confused - should I be using ArcGIS javascript 4.16 if I am not using ArcGIS Portal (which is a considerable outlay of effort and training and money). There are literally millions of apps that will break by updating to this.

0 Kudos
AnneFitz
Esri Regular Contributor

Hi Loran,

I am not able to reproduce the measurement issue that you are seeing above. 

Also, ArcGIS Portal and the ArcGIS API for JavaScript are two separate products that are not reliant on each other. You can use the ArcGIS API for JavaScript without using portal.

ArcGIS API for JavaScript: ArcGIS API for JavaScript | ArcGIS for Developers (Latest) 

Portal home page: Portal | Documentation for ArcGIS Enterprise 

Hope this helps! 

Thanks,

Anne

0 Kudos
LoranHayden1
Emerging Contributor

Hi Anne: I noted yesterday that the measure widget was completely snafued and assumed someone must be working on it. Today it seems well-behaved and working perfectly, so I don't know what you (or someone else?) did but it's working now. Thanks.