how to activate SceneView.toScreen() upon Polygon points (2D or 3D)

78
0
03-19-2021 05:11 AM
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), on our compamy portal (version 10.7.1).

I am still a newbie...

I need do screenshot around polygon extent - not by dragging mouse, but automatically, i.e. to get automatically the extent ( + 10%) and do screenshot over it.

I can get the extent, but screensot works with x,y screen pixels, whilst I have x,y coordinates on map.

my feature layer spatial reference is NOT geographic, but grid - it is wkid:2039 (Israel TM Grid).

if I try to do 

let p = new Point({
   x: poly.extent.center.x,
   y: poly.extent.center.y,
   z: 0,
   spatialReference: poly.spatialReference
});
let screenP = that.sceneView.toScreen(p);

Then I still get exagerated values for x,y

So, how to translate the polygon extent coordinates to screen coordinates?

Help will be greatly appreciated.

 

How to covert x,y map coordinates, to x,y screen coordinates?

Help wiil be greatly appreciated

0 Kudos
0 Replies