Custom Space Planner App

507
3
12-27-2023 03:07 AM
AbhyanshuGupta
New Contributor III

Hi,

I am trying to create a custom Space Planner App using ReactJS and JavaScript API of Esri's ArcGIS, I have created a web map for the use of in Indoors Space Planner app and it runs perfectly with the Space Planner App. Now when i am trying to use the same web map in my custom application, i am able to access it with no problems. Now in my use case if i want to Un assign a person occupied to an unit, i modified the popup and added a button called Unassign so when the user clicks on the button the Person allocated should be unassigned (You can see that in the first image). Now the issue i am facing is that what i have done is that on the click of the unassign button, i have extracted the unit for which the popup was opened and toggled its ASSIGNMENT_TYPE value from office to none. 

1.png

In this the update on the ASSIGNMENT_TYPE is happening with no issues (as the symbology is changing which is based on the ASSIGNMENT_TYPE value if its office then lines are shown on the unit or else no symbol is there) but the labelling is not changing, it should change from the occupants name who has been removed back to the units name.

2.png

 

Can someone please help me in rectifying this issue. Am I following the correct procedure for unassigning that is i am just switching the value of assignment type from "office" to "none" for the unit or am i supposed to follow any other procedure or change?

Regards 

0 Kudos
3 Replies
Jinho_Kang
Occasional Contributor

If you observe the Space Planner App's action,

1. Unassignment:

  • The occupant feature layer's point geometry is removed.
  • Unit_ID is wiped.
  • Only the attribute table remains.

2. Assignment:

  • The occupant feature layer's point geometry is added.
  • Unit_ID is populated. (inherited from the Units feature layer)

Those two are just assignment/unassignment behaviors.

Hotel configuration also edits the AREA_ID in the Occupants layer and Area/AreaRole tables.

I'd recommend observing all the modifications that are happening between the Space Planner App and Units and Occupants layers and two tables before creating the custom app.

0 Kudos
AbhyanshuGupta
New Contributor III

Thanks @Jinho_Kang for your response. I did try to observe the modifications which happen to the layers on assignment and un assignment, but didnt get any good output(only thing i noticed was that assignment type is set from office to none for that unit). Would you suggest a way i could notice the changes which happen to these layers when i assign or unassign a person to a unit. Also i did try removing the occupants layer geometry by putting it to null for that particular occupant and also setting the occupants unit id to null but this is not making any change and its the same issue which i was facing earlier that instead of showing the units name on which i have unassigned the occupants, the occupants name( who has been removed) is still being showed.

For removing the geometry i am extracting that particular occupant from the occupants layer and setting its geometry to NULL and unit id to NULL, is this the correct way or am i supposed to follow some other way?

0 Kudos
JasonHineEsri
New Contributor III

Hi @AbhyanshuGupta --

Is the Occupants feature service on ArcGIS Online, or on Enterprise? When unassigning an occupant on ArcGIS Online, the occupant's point geometry should be set to Null. When on Enterprise, the occupant's point geometry should be set to 0,0, because an Enterprise geodatabase won't allow null geometry.  

0 Kudos