Matt, If you are just talking text then here is a easy little mod for the ExportMap Widget: protected function export():void { var map:Map = ViewerContainer.getInstance().mapManager.map; map.infoWindow.hide(); map.infoWindowContent = null; loader.visible = true; img.filters =[cOver]; const encoder: JPEGEncoder = new JPEGEncoder(quality); map.logoVisible=logovis; map.scaleBarVisible=sbvis; map.zoomSliderVisible = zoomslidevis; map.opaqueBackground = mapbg; var mText:Label = new Label(); mText.text = "Hello World!"; mText.right = 5; mText.bottom = 5; mText.setStyle("color", "0x000000"); map.staticLayer.addElement(mText); map.validateNow(); const imageSnapshot:ImageSnapshot = ImageSnapshot.captureImage(map,0,encoder); map.scaleBarVisible=true; map.opaqueBackground = null; map.staticLayer.removeElement(mText); map.validateNow(); const fileReference:FileReference = new FileReference(); fileReference.save(imageSnapshot.data,fName); fileReference.addEventListener(Event.COMPLETE, resetIcon); fileReference.addEventListener(Event.CANCEL, resetIcon); }
protected function export():void { var map:Map = ViewerContainer.getInstance().mapManager.map; map.infoWindow.hide(); map.infoWindowContent = null; loader.visible = true; img.filters =[cOver]; const encoder: JPEGEncoder = new JPEGEncoder(quality); map.logoVisible=logovis; map.scaleBarVisible=sbvis; map.zoomSliderVisible = zoomslidevis; map.opaqueBackground = mapbg; var mText:Label = new Label(); mText.text = "Hello World!"; mText.right = 5; mText.bottom = 5; mText.setStyle("color", "0x000000"); map.staticLayer.addElement(mText); map.validateNow(); const imageSnapshot:ImageSnapshot = ImageSnapshot.captureImage(map,0,encoder); map.scaleBarVisible=true; map.opaqueBackground = null; map.staticLayer.removeElement(mText); map.validateNow(); const fileReference:FileReference = new FileReference(); fileReference.save(imageSnapshot.data,fName); fileReference.addEventListener(Event.COMPLETE, resetIcon); fileReference.addEventListener(Event.CANCEL, resetIcon); }
<?xml version="1.0" ?> <configuration> <title>ArcGIS Viewer for Flex</title> <logo>assets/images/logo.png</logo> <style> <colors>0xffffff,0x333333,0x101010,0x0,0xffd700</colors> <alpha>0.8</alpha> </style> <!-- replace the following url with your own geometryservice --> <geometryservice url="http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer" useproxy="false"/> <widgetcontainer layout="float"> <widget icon="assets/images/i_target.png" label="Find an address" config="widgets/Locate/LocateWidget.xml" url="widgets/Locate/LocateWidget.swf"/> <widget icon="assets/images/i_draw2.png" label="Draw and Measure" config="widgets/Draw/DrawWidget.xml" url="widgets/Draw/DrawWidget.swf"/> <widget icon="assets/images/i_print.png" label="Print" config="widgets/Print/PrintWidget.xml" url="widgets/Print/PrintWidget.swf"/> </widgetcontainer> <widget url="widgets/Navigation/NavigationWidget.swf" config="widgets/Navigation/NavigationWidget.xml" left="10" top="50"/> <widget url="widgets/OverviewMap/OverviewMapWidget.swf" config="widgets/OverviewMap/OverviewMapWidget.xml" right="-2" bottom="-2"/> <widget url="widgets/MapSwitcher/MapSwitcherWidget.swf" config="widgets/MapSwitcher/MapSwitcherWidget.xml" right="20" top="55"/> <widget url="widgets/HeaderController/HeaderControllerWidget.swf" config="widgets/HeaderController/HeaderControllerWidget.xml" left="0" top="0"/> <widget url="widgets/ExportMap/exportMap.swf" config="widgets/ExportMap/exportMap.xml" left="3" bottom="45"/> <map esrilogovisible="true" openhandcursorvisible="true" scalebarvisible="true" zoomslidervisible="false" wraparound180="true" addarcgisbasemaps="true" top="40"/> </configuration>
contain an interface, such as map title, map layout options and include map attribute layers
Another great widget from Robert which is much appreciated.I would like to fire off the widget from the toolbar instead of the current lower left position.I edited the config.xml to place the widget in the toolbar but as expected, when you click on it the widget appears in the lower left and you have to click on it again to run it.What code changes would be needed to just fire it from the toolbar?Thanks again Robert.Nestor.
Jeff, Updated version 2.2 is now in the code gallery.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.