Select to view content in your preferred language

PrintTask and text symbols with glow filter

2311
0
11-10-2013 05:34 PM
AndrewThomas
Deactivated User
I am having trouble with converting a text symbol with a glow filter (halo effect) to a Export Web Map Task text symbol with halo attributes.

My app is based on an old flex viewer app that I have upgraded the flex API a couple of times over the last few years.

It's currently using the 3.1 API from December 2012 and Flex 4.5.
The export Web Task is 10.11

The app has the draw widget and the print widget.

This is basically the code that adds a graphic to the map:

protected function addText(myGraphicsLayer:GraphicsLayer):void
{
var txtSym:TextSymbol = new TextSymbol("hello world"); 
txtFormat = new TextFormat("Arial", 12, 0xFF0000,null,null,null);
txtSym.textFormat = txtFormat;
     
var gra:Graphic = new Graphic(measurePt);
gra.symbol = txtSym;
gra.filters = [glowText];

myGraphicsLayer.add(gra)
}
...

<fx:Declarations>
<s:GlowFilter id="glowText" blurX="3.0" blurY="3.0" alpha="1" color="#FFFFFF" strength="7"/>
</fx:Declarations>
  



This appears on the map nicely as red text with a white halo. Cool.
Note: The Halo is required as the text will often be unreadable over a map.

Now if I try to print that using the PrintTask:


private function printButton_exportWebMapClickHandler(event:MouseEvent):void
{

...
 printTask.execute(printParameters);
...
}


...

 <fx:Declarations>
        <esri:PrintTask id="printTask"
                        executeComplete="printTask_executeCompleteHandler(event)"
                        fault="printTask_faultHandler(event)"
                        getResultDataComplete="printTask_getResultDataCompleteHandler(event)"
                        getServiceInfoComplete="printTask_getServiceInfoCompleteHandler(event)"
                        jobComplete="printTask_jobCompleteHandler(event)"
                        showBusyCursor="true"/>

  <esri:PrintParameters id="printParameters"
   format="{formatsDDL.selectedItem}"
   layoutTemplate="{layoutTemplatesDDL.selectedItem}"
   map="{map}"
   preserveScale="true" >    
            <esri:layoutOptions>
                <esri:LayoutOptions id="layoutOptions"/>
            </esri:layoutOptions>
   <esri:exportOptions>
    <esri:ExportOptions dpi="200"/>
   </esri:exportOptions>
        </esri:PrintParameters>
    </fx:Declarations>


The print result has no halo effect and the text is difficult to read depending on the map underneath.

If I debug the print parameters being sent to the printTask - I.E. PrintParameters->map->layers->myGraphicsLayer->GraphicsProvider[myGraphic] , there is nothing related to the glow filter.

Even if there was, it probably wouldn't get translated to the halo attributes on the ExportWebMapTask text symbol specifications like most of the other attributes are.

So what do other people do for the Halo effect if not apply a glow filter? There is the 'background' attributes on a text symbol which looks terrible on the map.

Worst case scenario - can I intercept the 'Web_Map_as_JSON' outgoing request parameter and add halo attributes to all text symbols?

I feel like I'm missing something or there is some basic functionality missing.

Regards

Andrew
Tags (2)
0 Kudos
0 Replies