POST
|
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
... View more
11-10-2013
05:34 PM
|
0
|
0
|
2196
|
POST
|
We have experienced the same issue with these server requests no longer accepting the file extensions. We are using flex but our requests have never requested the file extension. We do have a custom application which is requesting the .png file extensions and now no longer works. It has the same error as you describe above. We are struggling to find 10.1 server documentation around this issue. Did you get anywhere on this?
... View more
05-13-2013
01:04 PM
|
0
|
0
|
216
|
POST
|
Thanks Ivan. Yes, the new download does work and I managed to change my code to work around the issues. I didn't really get to the bottom of it though. P.S. map click event listener works fine when placed in right place and added in right moment I still think something has changed though. Perhaps it wasn't in the right place and wasn't added at the right moment in the previous version but it worked anyway.... and now it does not. I have come across a few undocumented changes - or at least I haven't found the documentation despite my best efforts.
... View more
03-05-2013
04:28 PM
|
0
|
0
|
152
|
POST
|
I have a flex application I am migrating from API 2.4/Flex SDK4.5 to API 3.1 (December 2012 release)/Flex SDK4.6. The application has an editing of feature layers without using the editor. I have a feature layer with a click event listener. This feature layer click event handler shows an info window and adds a map click event listener to the map. The map click event clears the layer selection and hides the info window. In other words, user clicks on a feature and a pop up appears. If the user clicks anywhere on the map, the feature is deselected and the popup hides. After the migration however, the map click event handler is called even though the listener is added by the feature click event handler. It seems like it's remembering the map click event (when the user clicked on the feature) and when the map click event listener is added to the map, the map click handler is called from an event that occurred before it started listening (an echo perhaps?). Don't believe me? Try this (it only takes a few minutes): In Flash builder: Create a new project using the 4.6 SDK Add an SWC reference to the 12/12/12 ArcGIS for flex API library in the project properties (Flex Build path) In the default mxml file, copy and paste the contents from the edit without editor sample below Run the mxml (in debug mode preferably) In the Browser: If no polygon exists: Create a polygon Click the 'select features by rectangle' Click on the rectangle to change the tool. Click 'Clear Selection' When a polygon exists: Click in the feature and try and change the vertex points. They disappear a split second after the feature is clicked which is different behaviour to the on-line example. Add a break point on the map click event handler to show that this is in fact being called when the feature is clicked. However, presumably the samples are using the latest 12/12/12 API release (from what I can tell from the swf file modification date), which means there is something with my environment which is causing this problem???? I would appreciate someone else trying to replicate this problem. On-line Example/Sample: http://resources.arcgis.com/en/help/flex-api/samples/index.html#/Edit_without_Editor/01nq00000043000000/ Latest ArcGIS flex API (12/12/12 at the time of post) http://www.esri.com/apps/products/download/index.cfm?fuseaction=download.main&downloadid=849 I did notice the layer click handler method had a remove listener function right before it's added again. I don't know if that was a vain attempt to try and 'forget' existing map click events? Regards Andrew
... View more
02-25-2013
04:48 PM
|
0
|
3
|
2196
|
POST
|
Thanks Dasa. I would have thought these two were pretty much equivalent: var FavouritesJSON:String = JSONUtil.encode(ArrayOfAllFavourites.source); var FavouritesJSON:String = JSONUtil.encode(ArrayOfAllFavourites.toArray()); Regardless, neither worked as there was several nested array collections so I managed to pre-emptively alter those in other places before they ever got to this function. Those that I couldn't I had to manually parse the array collection and set the five properties. Not ideal but manageable in my case. It's strange that this suddenly didn't handle it at 3.1 but was OK at 2.4. Thanks Andrew
... View more
02-11-2013
05:02 PM
|
0
|
0
|
276
|
POST
|
I am migrating a flex application from ArcGIS flex API 2.4 / Flex SDK 4.5 to API 3.1 / Flex SDK 4.6 After changing all the occurences of JSON.decode and JSON.encode to use JSONUtil.encode/decode (importing com.esri.ags.utils.JSONUtil; ) I am getting runtime errors while debugging. The error message is: Error: Unknown Property: 'dispatchResetEvent'.
at mx.collections::ListCollectionView/http://www.adobe.com/2006/actionscript/flash/proxy::getProperty()
at JSON$/stringifySpecializedToString()
at JSON$/stringify()
at com.esri.ags.utils::JSONUtil$/encode()
at myProject.components::myProjectUserFavourites/UpdateFavouritesToServer() where dispatchResetEvent is part of the inherited object of an MX:ArrayCollection that I'm trying to encode: This worked fine at 2.4/4.5 but doesn't work at 3.1/4.6 Attached is the FlashBuilder Expression at the line that calls the encode where the error occurs: var FavouritesJSON:String = JSONUtil.encode(ArrayOfAllFavourites.source); Can anyone shed any light onto what might be the cause and or solution Cheers Andrew
... View more
02-06-2013
05:07 PM
|
0
|
2
|
1546
|
POST
|
Can anyone provide more details on this? I am having the same problem with the sampleFlexViewer using the 2.4 API (migration to 3.0 will be a couple of months away) I am loading a widget which draws a graphics layer which may or may not have any graphics. If the graphics layer has never had any graphics in it and a cluster is assigned, the widget will fail to open: "WeightedClusterer.as on line 113. The error is Error #1009: Cannot access a property or method of a null object reference" I can attach the cluster when the first graphic is added, but that's a bit ugly. I'm not sure what to apply the test above to (if (graphicCollection.length)) ? Is this a modification to WeightedClusterer.as line 113? If so, How do you actually modify your copy of the source library? Or do I assign an empty (I.E. not null) graphicCollection to..?....the GraphicsLayer?? Is 'GraphicCollection' an arrayCollection of graphics? Andrew
... View more
10-14-2012
06:21 PM
|
0
|
0
|
256
|
POST
|
Thanks Ivan. I tried your code and it helped me identify what I was doing wrong. I had the weights wrong - or rather, I didn't understand their effects. Basically what was happening I think is that if the weight of a particular cluster was outside of the weights array, there seemed to be no effect on changing the symbol. I.E. private var flareSymbol:FlareSymbol = new FlareSymbol();
private var myCluster:WeightedClusterer = new WeightedClusterer();
private var highlightFlareSymbol:FlareSymbol = new FlareSymbol();
public function init():void{
var clusterWeights:Array() = new Array(5,10);
flareSymbol.backgroundColors= new Array(0x00FF00,0xFF0000);
flareSymbol.weights=clusterWeights;
highlightFlareSymbol= new Array(0xFFFF00,0xFFFF00);
highlightFlareSymbol.weights=clusterWeights;
myCluster.symbol = flareSymbol;
graLayer.clusterer = myCluster;}
private functon highlight():void
{
...
if (conditions){
myClusterGraphic.symbol = highlightFlareSymbol;//This seems to have no effect unless the weight value is less than or equal to the maximum value in the clusterWeights array (E.G: 10)
}
} In this example above, a cluster graphic background colour would only change to yellow when the weight was less than or equal to 10. Solution - increase the maximum value of the array. Perhaps: var clusterWeights:Array() = new Array(5,500);
... View more
10-14-2012
03:07 PM
|
0
|
0
|
268
|
POST
|
I am trying to somehow indicate to a user a particular graphic on a map. The trigger for this is the mouse hovering over an item on a list. This is all pretty trivial until I changed the graphics to clustered graphics. The basic functionality I have currently is: I have a graphics layer used purely for highlighting items on a list to the user. Items in the list (datagrid) have an ID. Graphics in the graphics layer have this ID in their attributes. When a user hovers over an item on the list, a function is called which iterates through all graphics in the graphic provider of the graphics layer. If the graphic's attribute's ID matches the list items ID, the graphic's symbol is changed. On a hover out event, the symbol is changed back to the default symbol. This works well currently. Now if I additionally add a weightedCluster (with flare symbol) to the graphics layer, I want the cluster that contains the graphic corresponding to the list item to flash/highlight/flare/etc. The highlight function has to work slightly differently because the graphics layer's graphicProvider doesn't know about the cluster, I have to iterate through the graphic layers children, and inspect each graphic, if it is a 'ClusterGraphic', check it's graphics for a match. I can find the correct cluster graphic, but then I'm stuck on what to do. Changing the ClusterGraphic's Symbol does nothing, assigning it a new Flare Symbol also does nothing. What I have so far: var g:graphic = myGraphicOfInterest; for (var j:int = 0, m:int = graLayer.numChildren; j < m; j++) { var cgraphic:Graphic = graLayer.getChildAt(j) as Graphic; if (cgraphic is ClusterGraphic){ for each (var cg:Graphic in cgraphic.attributes.graphics){ if (cg.attributes == g.attributes){ //cgraphic.symbol = mySimpleMarkerSymbol;//Does nothing //dispatchEvent(new AppEvent(FlareEvent.FLARE_IN_START));//Something like this would be ideal var fs:FlareSymbol = new FlareSymbol(); fs.backgroundColor = 0x0000FF; fs.size = 40; cgraphic.symbol = fs; cgraphic.scaleX = 2; cgraphic.refresh(); graLayer.refresh(); } } } } None of these changes above has any effect on the graphic on the map when this is called. I can change properties of the already assigned FlareSymbol, but this changes ALL clusterGraphics, not just the one I want. The application if based on the Sample Flex Viewer. ActionScript code is appreciated over MXML. Does anyone have any ideas on what to try? Thanks Andrew
... View more
10-11-2012
06:38 PM
|
0
|
2
|
860
|
POST
|
I have a problem which I think I need to design a new solution to get around. I have a feature layer covering the entire extent of my map. On the layer load I add a graphic add event listener fLayer.addEventListener(GraphicEvent.GRAPHIC_ADD,fLayer_graphicAddHandler);
~
protected function fLayer_graphicAddHandler(event:GraphicEvent):void
{
event.graphic.addEventListener(MouseEvent.MOUSE_OVER, onMouseOverHandler);
event.graphic.addEventListener(MouseEvent.MOUSE_OUT, onMouseOutHandler);
}
The mouse over handler takes the attributes from the graphic and displays them on a status bar, so the user has a live display of data under the mouse at all times. I also have another feature layer which is interactive (assigned to an attribute inspector ). When the user hovers the mouse over that feature, the cursor changes and a tooltip is displayed. Obviously when the user clicks on the feature the attribute inspector is displayed. However, It seems the mouse can only be over one feature or the other, whichever feature layer is added to the map with the highest index. i guess this is by design. So if the entire extent layer is on top, the user can never interact with the interactive features, when the interactive features are on top, the user will never see data on the status bar when the mouse is over a feature from the interactive layer. Is there anything that can be done or do I need to come up with a whole new solution, such as having a distinct tool for the live feed layer, so that when the tool is active, the layer is on top or something? I'm using an app based on the SampleFlexViewer and the flex api version 2.4 (I could go up to 2.5 or 3 if required)
... View more
07-18-2012
05:52 PM
|
0
|
1
|
705
|
POST
|
Yep, web marshal was the culprit. All resolved now. Thanks
... View more
05-02-2012
08:44 PM
|
0
|
0
|
442
|
POST
|
I wonder if their web marshal is blocking .swz files? I've asked their IT person that but could take a couple of days to get a reply. Is that actually what's actually happening? Is it trying to download these .swz files form Adobe.com? Or is the verification from Adobe failing for a different reason then the .swz file download from us is failing? Note: It appears that it is possible to download the .swz files from our nginx web server. Thanks, and we'll see what their IT person comes back with. Cheers Andrew
... View more
04-29-2012
09:13 PM
|
0
|
0
|
442
|
POST
|
[ATTACH=CONFIG]13868[/ATTACH] I did get him to do that a few weeks ago. Attached is a fiddler2 screenshot of the responses I get when I attempt (7 in total) Their equivalent screenshot only shows the first 3 responses(all 200 with the same URL's and body size) and then no further requests are made. I'll change the framework linkage and see if that has any effect. Thanks Andrew
... View more
04-26-2012
07:52 PM
|
0
|
0
|
442
|
POST
|
I have deployed a product based on the Sample Flex viewer. It's working fine for most users, except for one organisation that has it's users quite heavily locked down. They have restricted internet access and users do not have local admin permissions on their Windows 7/IE9 machines. When they go to our site, the get a white screen with a '2046 error' at the bottom of the page. According to the Adobe site, this is something to do with - Runtime Shared Libraries (RSL's) could not be verified. Apparently you can embed the RSL's in the project but I can't find out how to do this. When their IT administrator logs into their machine, he can access the site fine. He has local admin rights. The users are able to go to adobe.com and update their flash version. Attached is a screenshot of the Flex Build Path settings I tried unticking 'Verify RSL digests (recommended for production)' in the Flashbuilder->project->property->Flex build path menu but that seemed to have no effect. I'm starting to run out of ideas to try. I'm using Flash builder 4.5 (4.5 SDK) ArcGIS lib 2.4 Rant: Does anyone else find restrictive IT policies seem to be counter-productive? Cheers Andrew
... View more
04-25-2012
03:24 PM
|
0
|
5
|
4018
|
POST
|
ibespalov, I think I'm wishing for something that isn't possible. Just a bit of Background: I'm trying to replicate this below in SampleFlexViewer: Sample feature layer based on mapserver layer But since the mapservice Layer in question is already loaded/added to the map object, I'm trying to get away with not adding it again to the map as a feature layer. At the moment I am adding it as a feature layer with null symbol style and null outline, so the user can't actually tell that it's been added twice. When I tried your code above, the fLayer_graphicAddHandler event is never fired. I guess this can't be fired until features(graphics) are added to the map. and this can't happen if the featurelayer isn't added to the map. I think I will end up using your code for something else I want to do though, so thanks. Thanks Andrew
... View more
04-25-2012
02:37 PM
|
0
|
0
|
368
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|