1 :confused: from your codeif(drawingLine == true)
if (drawingLine)
2 :confused: from your codethis.view.xCordTxt.text.toString()
this.view.xCordTxt.text
this.view.xCordTxt.text.length > 0 or this.view.xCordTxt.text != ""
3 :confused: from your code// create new point based on input coordinates and Map spatial reference
var mapPoint:MapPoint = new MapPoint(Number(this.view.xCordTxt.text), Number(this.view.yCordTxt.text), baseWidget.map.spatialReference);
// create new point based on existing point with NOT Map spatial reference
var webMapPoint:MapPoint = WebMercatorUtil.geographicToWebMercator(mapPoint) as MapPoint;
if (drawingPoint == true)
{
mapPointArray.length = 0;
mapPointArray.push(webMapPoint);
// center at no one knows where,
// because map spatial ref. not equals with center point spatial ref.
baseWidget.map.centerAt(webMapPoint);
createPoint(false);
}4 a good way to understand what's happening in this pile of code - listening events, debug code, trace some info to consoleprivate function addGraphicsLayer():void
{
_graphicsLayer = new GraphicsLayer();
_graphicsLayer.name = "DrawGraphics";
_graphicsLayer.id = "DrawGraphicsID";
// Fires after layer properties for the layer are successfully populated.
_graphicsLayer.addEventListener(LayerEvent.LOAD, onLayerLoad);
// Fires when a graphic is added to the GraphicsLayer.
_graphicsLayer.addEventListener(GraphicEvent.GRAPHIC_ADD, onGraphicAdd);
// Fires when all graphics in the GraphicsLayer are cleared.
_graphicsLayer.addEventListener(GraphicsLayerEvent.GRAPHICS_CLEAR, onGraphicClear);
...
}
protected function onLayerLoad(event:LayerEvent):void
{
// now you can work with layer
trace("Layer with id='" + event.layer.id + "' added to map");
}
protected function onGraphicAdd(event:GraphicEvent):void
{
// now you can work with added graphic - zoom to it, change symbol, tooltip, attributes ...
var gr:Graphic = event.graphic;
trace("Graphic with id='" + gr.id + "' just added");
}
protected function onGraphicClear(event:GraphicsLayerEvent):void
{
// now graphics layer is empty
trace("Graphics layer is cleared");
}Good luck.