Esri / solutions-erg-widget

The Emergency Response Guide (ERG) widget allows users to determine potential hazards based on the type of chemical spill and user-selected location on the map.
Apache License 2.0
6 stars 4 forks source link

ERG: Some materials cause the widget to stop working #91

Closed tylergotatie closed 6 years ago

tylergotatie commented 6 years ago

Bug or Enhancement

There are a number of materials in the materials.json with a "IDNum": 0 and fewer variables than the other items. These materials show up in the widget without an ID number, if one of them is selected no zones will be created and the entire app will stop working. If the material in the json is given the expected number of variables then the widget will work.

Is there a reason for materials to have "IDNum": 0, and what seems to be incomplete variables?

Repo Steps or Enhancement details

Screenshots

adgiles commented 6 years ago

Hi Tyler,

Thank you for highlighting this issue, we are currently in the process of moving the widget into the core Web AppBuilder framework and have addressed this in the following issue:

https://github.com/Esri/solutions-erg-widget/issues/89

If you want to make the change on your own instance it is a fairly quick fix. Line 1005 in the widget.js just needs changing from:

if(this._selectedMaterial.Material.includes('Substances') || this._selectedMaterial.BLEVE) {

to:

if(this._selectedMaterial.IDNum === 0 || this._selectedMaterial.BLEVE) {

tylergotatie commented 6 years ago

Thanks! The widget runs when one of the IDNum:0 materials is selected. However I get this message. halifax_sa_erg_error

"There are no Protective Action distances for this material. Only the Initial Isolation and evacuation zones has been calculated"

Is there a reason why these materials do not have all zone distances?

adgiles commented 6 years ago

There are no figures in the Table 1 of the guide for materials with no id number