Select to view content in your preferred language

How to activate "coordinates" widget's internal function "onLocateClick" from "image" widget

291
0
03-19-2024 04:26 AM
Labels (2)
MichaelLev
Frequent Contributor

I use 2 custom widgets,
one is a copy of esri's original coordinates widget
and the other is a copy of esri's original image widget.
I can modify my copies as I wish.

The original image widget has a built -in option to sense when the user clicks it,
and I need that when the user clicks it,
it will activate the "onLocateClick" in my custom coordinates widget.

This is my first trial to make communication between 2 widgets in EXB

I see that both widgets - coordinates and image, do noyt have the Trigger/Message actions in the development system... and I do not understand why... and I do not know how to enable them to use this widgets communication way.

So, What I tried to do is:
   I declared public object "_myApp" in client/dist/experience/index.html
   and in my custom coordinates widget.tsx code,
   I aded a line "_myApp.coordinates = Widget"
   before its export line at the end of the file.

What I gained is that my custom image widget have access to _myApp.coordinates
but from this point I am stuck, since I have no access to the coordinates internal "onLocateClick" function.

I am new to React, so help will be greatly appreciated

0 Kudos
0 Replies