Daniel, Here is a link to some info on what you are looking to do. You will have to extend any examples of what you find to met your specific needs.http://forums.esri.com/Thread.asp?c=158&f=2421&t=266031&mc=10.
<?xml version="1.0" encoding="utf-8"?> <!-- //////////////////////////////////////////////////////////////////////////////// // // Display the extent URL for the user // //////////////////////////////////////////////////////////////////////////////// --> <BaseWidget xmlns ="com.esri.solutions.flexviewer.*" xmlns:mx ="http://www.adobe.com/2006/mxml" x ="600" y ="220" widgetConfigLoaded ="init()"> <mx:Script> <![CDATA[ import mx.controls.Alert; import com.esri.ags.Map; private function init():void { txtVersion.text = "https://server.com/flex/index.html?EXT=" + String(map.extent.xmin) + "," + String(map.extent.ymin) + "," + String(map.extent.xmax) + "," + String(map.extent.ymax); } ]]> </mx:Script> <WidgetTemplate> <mx:Canvas id="viewStack" width="100%" height="100%" horizontalScrollPolicy="off"> <mx:VBox width="100%" paddingTop="15"> <mx:Text id="txtTitle" styleName="AboutTitle" text="URL for copying" width="100%" /> <mx:Text id="txtSubtitle" styleName="AboutSubtitle" text="You can highlight and right-click (or CTRL-C) to copy the URL:" width="100%" /> <mx:Text id="txtVersion" styleName="AboutVersion" text="" width="100%" /> </mx:VBox> </mx:Canvas> </WidgetTemplate> </BaseWidget>
private function init():void { map.addEventListener(ExtentEvent.EXTENT_CHANGE, repositionInfo); txtVersion.text = "https://server.com/flex/index.html?EXT=" + String(map.extent.xmin) + "," + String(map.extent.ymin) + "," + String(map.extent.xmax) + "," + String(map.extent.ymax); } private function repositionInfo(event:Event):void { txtVersion.text = "https://server.com/flex/index.html?EXT=" + String(map.extent.xmin) + "," + String(map.extent.ymin) + "," + String(map.extent.xmax) + "," + String(map.extent.ymax); }
<?xml version="1.0" encoding="utf-8"?> <!-- //////////////////////////////////////////////////////////////////////////////// // // Display the extent URL for the user // //////////////////////////////////////////////////////////////////////////////// --> <BaseWidget xmlns ="com.esri.solutions.flexviewer.*" xmlns:mx ="http://www.adobe.com/2006/mxml" x ="600" y ="220" creationComplete ="init()"> <mx:Script> <![CDATA[ import com.esri.ags.events.ExtentEvent; import com.esri.ags.Map; private function init():void { map.addEventListener(ExtentEvent.EXTENT_CHANGE, repositionInfo); txtVersion.text = "https://server.com/flex/index.html?EXT=" + String(map.extent.xmin) + "," + String(map.extent.ymin) + "," + String(map.extent.xmax) + "," + String(map.extent.ymax); } private function widgetOpenedHandler(event:Event):void { map.removeEventListener(ExtentEvent.EXTENT_CHANGE, repositionInfo); map.addEventListener(ExtentEvent.EXTENT_CHANGE, repositionInfo); txtVersion.text = "https://server.com/flex/index.html?EXT=" + String(map.extent.xmin) + "," + String(map.extent.ymin) + "," + String(map.extent.xmax) + "," + String(map.extent.ymax); } private function repositionInfo(event:Event):void { txtVersion.text = "https://server.com/flex/index.html?EXT=" + String(map.extent.xmin) + "," + String(map.extent.ymin) + "," + String(map.extent.xmax) + "," + String(map.extent.ymax); } private function widgetClosedHandler(event:Event):void { map.removeEventListener(ExtentEvent.EXTENT_CHANGE, repositionInfo); } ]]> </mx:Script> <WidgetTemplate widgetOpened="widgetOpenedHandler(event)" widgetClosed="widgetClosedHandler(event)" widgetMinimized="widgetClosedHandler(event)"> <mx:Canvas id="viewStack" width="100%" height="100%" horizontalScrollPolicy="off"> <mx:VBox width="100%" paddingTop="15"> <mx:Text id="txtTitle" styleName="AboutTitle" text="URL for copying" width="100%" /> <mx:Text id="txtSubtitle" styleName="AboutSubtitle" text="You can highlight and right-click (or CTRL-C) to copy the URL:" width="100%" /> <mx:Text id="txtVersion" styleName="AboutVersion" text="" width="100%" /> </mx:VBox> </mx:Canvas> </WidgetTemplate> </BaseWidget>
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.