Using Draw, i'm creating a circle (drag'n drop or click) from center point (lat and long) and radius.
drawRadiusCircle: function() {
this._clearGraphicLayers();
this.map.disableMapNavigation();
this.map.disableDoubleClickZoom();
this.map.hideZoomSlider();
this.map.setMapCursor(DRAW_CURSOR);
radius.activate(Draw.CIRCLE);
if (!this.mouseDragDrawListener) {
this.mouseDragDrawListener = this.map.on("mouse-drag", lang.hitch(this, this._mouseDragDrawHandler));
}
},
_mouseDragDrawHandler: function(event) {
this.isDrawDragged = true;
},
addDrawToMap: function(event) {
radius.deactivate();
if (this.mouseDragDrawListener) {
this.mouseDragDrawListener.remove();
this.mouseDragDrawListener = null;
}
var center = event.geometry.getCentroid();
var normalizedCenter = webMercatorUtils.xyToLngLat(center.x, center.y);
var centerX = normalizedCenter[0];
var centerY = normalizedCenter[1];
this.latitudeInput.set('value', centerY);
this.longitudeInput.set('value', centerX);
var point = event.geometry.getPoint(0, 0);
var normalizedPoint = webMercatorUtils.xyToLngLat(point.x, point.y);
var pointX = normalizedPoint[0];
var pointY = normalizedPoint[1];
var line = new Polyline([[pointX,pointY],[centerX,centerY]]);
var rad = geometryEngine.geodesicLength(line, this._rangeUnitSelectionValue());
if (this.isDrawDragged) {
this.rangeRadiusInput.set('value', rad);
this.isDrawDragged = false;
}
this.map.setMapCursor(DEFAULT_CURSOR);
this.map.enableMapNavigation();
this.map.enableDoubleClickZoom();
this.map.showZoomSlider();
this.drawRadiusCircleAndQueryData();
},
Callling this.drawRadiusCircleAndQueryData create the layer and the graphic (the circle using the below):
return new Circle({
center: this._centerPointByInputs(),
radius: this._rangeRadiusInputValue(),
radiusUnit: this._radiusUnitType(),
geodesic: true
});
Using Edit for MOVE, I'm cannot get the new center point of the graphic
var graphic = this._radiusLayer.graphics[0];
editToolbar.activate(Edit.MOVE, graphic, options);
Getting this error:
Error: <path> attribute d: Expected moveto path command ('M' or 'm'), "Z".
There is any way to get the new coordinate of the circle?
Thanks