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-when-drag-the-map/m-p/1087330#M74222(In case anyone else stumbles along looking for an answer)
Hi CourtneyMenikheim
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 outIs that correct?
Yes, that is correct!
Thanks!
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.