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);
}
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); }