Hi,
I have a question, I use SketchViewModel to draw the shape on map, I want to keep the shape located in center (not moving) when the zoom in/out the map; how can I implement it?
Thanks in advance.
Use the center of the screen as the coordinates of your graphic.
var x = window.innerWidth / 2;
var y = window.innerHeight / 2;
Thanks LefterisKoumis.
If the shape is not in center, how make the shape looks like keeping statis position and size?
This question is answered on this thread: https://community.esri.com/t5/arcgis-api-for-javascript-questions/how-to-make-graphic-not-moving-whe...
(In case anyone else stumbles along looking for an answer)
Your mentioned thread is keeping the shape not moved when moving the map; but how to keep the shape not scale and move (size and position looks like unchange in screen) when zooming the map; adjust the coordinates of shape seems that cannot get the desired effect.
Could you give some helps, thanks!
Thanks.
To clarify, you want the shape:
- to be on the map
- to stay on the screen in the same spot, even as the user pans the map
- to stay the same size, even as the user zooms in and out
Is that correct?
Yes, that is correct!
Thanks!