Can't move the circle on the map after creating it and add it on the SkechViewModel graphic layer

354
3
Jump to solution
05-04-2021 06:41 AM
LindsayWatson
New Contributor II

Hi, I am using SketchViewModel to draw shapes on the map, but since you can't really specify the radius of a circle, I have to create a circle using the Circle class with Center and Radius and add it on the SketchViewModel graphic layer. But the problem is, once I create the circle and add it on the map, I can enter the edit mode to select the circle (extent box shows, graphic is highlighted...) BUT, I can't move the circle to other location like the graphic I created use SketchViewModel. What did I miss? Can anyone help me? 

THanks!

0 Kudos
2 Solutions

Accepted Solutions
UndralBatsukh
Esri Regular Contributor

Hi there, 

What you are seeing is right. SketchViewModel can create points, lines and polygons. I created a simple test app for you where

1. I am creating a point using a sketch view model.

2. Then create a buffer around the point with a specified distance and unit (1000 km). 

3. User then click on a point to select it and move it

4. As user moves the point over the map, I recalculate the buffer and adjust the buffer. 

This app was inspired by this sample

Hope this helps,

-Undral

View solution in original post

0 Kudos
UndralBatsukh
Esri Regular Contributor

Yes it is an expected behavior. 

-Undral

View solution in original post

0 Kudos
3 Replies
UndralBatsukh
Esri Regular Contributor

Hi there, 

What you are seeing is right. SketchViewModel can create points, lines and polygons. I created a simple test app for you where

1. I am creating a point using a sketch view model.

2. Then create a buffer around the point with a specified distance and unit (1000 km). 

3. User then click on a point to select it and move it

4. As user moves the point over the map, I recalculate the buffer and adjust the buffer. 

This app was inspired by this sample

Hope this helps,

-Undral

0 Kudos
LindsayWatson
New Contributor II

Thanks so much for the reply!
I've tried two ways to add a circle (other than the SketchViewMode circle tool due to radius requests) One is using the buffer method you were showing, which works great, I can add the graphic and edit and move it.
It's the other way where I use the CircleConstructor, this doesn't work. I can create and add the circle on the layer, and I can select it and enter edit mode, but I just can't move it. It's like the circle pines on the center. Are you saying this is expected behavior of SketchViewMode?

0 Kudos
UndralBatsukh
Esri Regular Contributor

Yes it is an expected behavior. 

-Undral

0 Kudos