import com.esri.ags.geometry.MapPoint;
Thanks Robert for looking at this. I've had warnings pop up in my console about some of the esri classes I'm importing. Warnings such as:The class com.esri.ags.geometry.MapPoint has been used in a call to net.registerClassAlias() in _ModRound2Form_FlexInit. This will cause Round2Form:ModRound2Form to be leaked. To resolve the leak, define com.esri.ags.geometry.MapPoint in the top-level application.
protected function MapClickHandler(event:MapMouseEvent):void { const mapPoint:MapPoint = event.mapPoint; mapPoint.spatialReference = new SpatialReference(102100); var myGraphicMarker:Graphic = new Graphic(mapPoint, new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_DIAMOND, 22, 0x009933)); myGraphicMarker.toolTip = "Marker added with ActionScript"; pointGraphicsLayer.add(myGraphicMarker); pointGraphicsLayer.refresh(); }
<esri:Map id="theMap" mapClick="MapClickHandler(event)"> <esri:GraphicsLayer id="pointGraphicsLayer" /> </esri:Map>
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.