<?xml version="1.0" encoding="utf-8"?> <viewer:BaseWidget?xmlns:fx="com.esri.viewer.*" ?????????????????????? ????? ?? widgetConfigLoaded="init()"> ???????import?com.esri.ags.events.DrawEvent; ?????????????????????import?com.esri.ags.layers.GraphicsLayer; ?????????????????????import?com.esri.ags.tools.DrawTool; ?????????????????????import?com.esri.ags.tools.NavigationTool; ?????????????????????import?com.esri.viewer.ViewerContainer; ? ?????????????????????var?helloContent:String; ?????????????????????var?graphicsLayer:GraphicsLayer; ? ?????????????????????if?(configXML){ ?????????????????????? ???????????? helloContent=String(configXML.hellocontent); ?????????????????????? ????? } ?????????????????????? ????? graphicsLayer=new?GraphicsLayer(); ?????????????????????? ????? map.addLayer(graphicsLayer);① ???????????????????? } ? ?????????????????????function?sayHiToMapManager():void{② var?infoData:Object={content: helloContent,point: map.extent.center}; ?????????????????????? ??????this.showInfoWindow(infoData); ???????????????????? } ? ?????????????????????private?function?activateMapNavigation?(tool:String):void{③ ?????????????????????? ??????this.setMapNavigation(tool,?null); ???????????????????? } ? ?????????????????????function?draw(shape:String):void{④ ?????????????????????? ??????this.setMapAction(shape,255)">null,drawEnd); ???????????????????? } ?????????????????????function?drawEnd(event:DrawEvent):void{⑤ ?????????????????????? ????? graphicsLayer.add(event.graphic); ???????????????????? } ????????????? ]]> ???????</fx:Script> ???????<viewer:WidgetTemplate?width="680"?height="200"> ??????????????<s:VGroup?width="100%"?height="100%" ?????????????????????? ????? ? verticalAlign="middle"?horizontalAlign="center"> ?????????????????????<s:HGroup?width="100%"> ?????????????????????? ??????<s:Button?label="Say Hi to MapManager" ?????????????????????? ??????????????????? ? click="sayHiToMapManager()"/> ?????????????????????</s:HGroup> ?????????????????????<s:HGroup?width="100%">⑥ ???????????????????? ???<s:Button?label="Zoom In" ???????????????????? ?? click="activateMapNavigation(NavigationTool.ZOOM_IN)"/> ???????????????????? ???<s:Button?label="Zoom Out" ???????????????????? ?? click="activateMapNavigation(NavigationTool.ZOOM_OUT)"/> ???????????????????? ???<s:Button?label="Pan" ???????????????????? ?? click="activateMapNavigation(NavigationTool.PAN)"/> ?????????????????????? ??????<s:Button?label="Previous View" click="activateMapNavigation(ViewerContainer.NAVIGATION_ZOOM_PREVIOUS) "/> ?????????????????????? ??????<s:Button?label="Next View" click="activateMapNavigation(ViewerContainer.NAVIGATION_ZOOM_NEXT)"/> ?????????????????????? ??????<s:Button?label="Full Extent"????????????????????? ???????????????????? ? click="activateMapNavigation(ViewerContainer.NAVIGATION_ZOOM_FULL)"/> ?????????????????????</s:HGroup> ?????????????????????<s:HGroup?width="100%">⑦ ?????????????????????? ??????<s:Button?label="Point" ?????????????????????? ??????????????????? ? click="draw(DrawTool.MAPPOINT)"/> ?????????????????????? ??????<s:Button?label="Polyline" ?????? ??????????????????????&n bsp;??????????? ? click="draw(DrawTool.POLYLINE)"/> ?????????????????????? ??????<s:Button?label="Polygon" ?????????????????????? ??????????????????? ? click="draw(DrawTool.POLYGON)"/> ?????????????????????? ??????<s:Button?label="Extent" ?????????????????????? ??????????????????? ? click="draw(DrawTool.EXTENT)"/> ?????????????????????? ??????<s:Button?label="Circle" ?????????????????????? ??????????????????? ? click="draw(DrawTool.CIRCLE)"/> ?????????????????????? ??????<s:Button?label="Freehand Polyline" ?????????????????????? ??????????????????? ? click="draw(DrawTool.FREEHAND_POLYLINE)"/> ?????????????????????? ??????<s:Button?label="Freehand Polygon" ?????????????????????? ??????????????????? ? click="draw(DrawTool.FREEHAND_POLYGON)"/> ?????????????????????</s:HGroup> ??????????????</s:VGroup> ???????</viewer:WidgetTemplate> </viewer:BaseWidget> |