WAB 2.17 3D modify Coordinate widget to track mouse movements continuously also on added coordinate systems

428
6
Jump to solution
01-27-2021 07:37 AM
Labels (2)
MichaelLev
Occasional Contributor III

I'm developing custom widgets for WAB (Develper Edtion) 2.17, Launchpad Theme, on 3D Scenes (ArcGIS API for javascript 4.17).

ESRI original WAB Widget "Coordnate" (3D) tracks mouse and displays the long,lat values as you move the mouse around. When I config "Coordinate" and add a 2nd coordinate system, in my case - wkid:2039, the widget stops tracking the mouse and I must click the map from time to time when I want to get the X,Y values.

How do I modify widget "Coordinate" code, in order that also for the added coordinate system, the widget will track mouse movements and constantly display X,Y values as I move the mouse around? 

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
MichaelLev
Occasional Contributor III

Dear  Robert , Thank you for answering.

Currently our basemap is one of the standard esri basemaps, so the map WKID is 102100 ...

But -- I'm sure there is at least one way which is also relatively easy!

In my WAB (Developer Edition) 2.17 application, instead of using the original WAB's "Coordnate" widget,
I can use the new ESRI's specific CoordinateConversion widget, developed specifically for this very purpose, i.e., to display mouse coordinates "on the fly" oncurrently for any several pre-defined coordinate systems (and the programme can add more).

This widget top description is here (this is same link as above). Click on map jumps to demo page (there I can jump to the sandbox).

In the above widget's top description page it's written: "Additional formats can be created by a developer and made available through the widget.", and below it, in "See also" links list, there are 2 relevant links:
Sample - Coordinate widget (jumps to the demo page mentioned above)
Sample - Add custom coordinate formats - This is most important - it shows by demo + sandbox how to add more coordinate systems (like wkid:2039).

I'll learn this matter, but as all this is new to me, maybe you can help me by showing me how to modify their sandbox code example, in order to add wkid:2039 (TFWKID:108021), so that I'll have something robust to start with?

With appreciation,
Michael

View solution in original post

0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Michael,

You will not be able to get live coordinates for any WKIDs other than 102100 or 4326. Live coordinates requires clientside calculation and there is no OTB support for this. So if your apps web map is using one of the standard esri basemaps then the maps WKID is 102100 and you will not be able to display 2039 coords. But if your web map uses 2039 coords for its basemap then you will be able to display 2039 in the live coordinates widget.

0 Kudos
MichaelLev
Occasional Contributor III

Dear  Robert , Thank you for answering.

Currently our basemap is one of the standard esri basemaps, so the map WKID is 102100 ...

But -- I'm sure there is at least one way which is also relatively easy!

In my WAB (Developer Edition) 2.17 application, instead of using the original WAB's "Coordnate" widget,
I can use the new ESRI's specific CoordinateConversion widget, developed specifically for this very purpose, i.e., to display mouse coordinates "on the fly" oncurrently for any several pre-defined coordinate systems (and the programme can add more).

This widget top description is here (this is same link as above). Click on map jumps to demo page (there I can jump to the sandbox).

In the above widget's top description page it's written: "Additional formats can be created by a developer and made available through the widget.", and below it, in "See also" links list, there are 2 relevant links:
Sample - Coordinate widget (jumps to the demo page mentioned above)
Sample - Add custom coordinate formats - This is most important - it shows by demo + sandbox how to add more coordinate systems (like wkid:2039).

I'll learn this matter, but as all this is new to me, maybe you can help me by showing me how to modify their sandbox code example, in order to add wkid:2039 (TFWKID:108021), so that I'll have something robust to start with?

With appreciation,
Michael

View solution in original post

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Sorry, I have no experience with that widget.

0 Kudos
MichaelLev
Occasional Contributor III

Dear Robert, I'll try by myself to replace WAB's Coordinate widget by a custom widget that activates the new CoordinateConversion widget after adding wkid:2039 to it, and I'll inform you.

Thank you,

Michael

0 Kudos
MichaelLev
Occasional Contributor III

Dear Robert, I succeeded.

Hwever, I failed to add "z" when I show the wkid:2039 x,y

I've posted a question in the API community.

Thanks for helping me entering esri WAB (Developer Edition) custom widgets world.

Michael

0 Kudos
MichaelLev
Occasional Contributor III

Vy the way, to my question (why I can't get z for wkid:2039) I got there an answer - that wkid:2039 does not support the vertical dimension.

Michael

0 Kudos