if(drawingLine == true) if (drawingLine)
this.view.xCordTxt.text.toString() this.view.xCordTxt.text this.view.xCordTxt.text.length > 0 or this.view.xCordTxt.text != ""
// 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); }
private 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"); }
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.