Select to view content in your preferred language

Print Widget Flex 3.6

1676
4
Jump to solution
05-21-2014 08:17 PM
NazriShah
Emerging Contributor
Hi,

I have shapefile widget and print widget in my flex.. The problem is when i try to print my uploaded polygon shapefile,
the output in the legend shows label error... it happens when i try to print polygon shapefiles, there's no problem when uploading point or polyline shapefiles..


I have posted this problem with Robert's shapefile discussion and he said this is an esri issues..

[ATTACH=CONFIG]33987[/ATTACH]
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Bjorn,

  In the ShapefileWidget I am already setting the name property of the LayerDetail so it must be a API issue.

            private function creatLayerDetails(sfr:ShapeFileResult, spatialReference:SpatialReference, isLabel:Boolean = false):LayerDetails             {                 var layerDetails:LayerDetails = new LayerDetails();                 layerDetails = new LayerDetails();                 layerDetails.canModifyLayer = false;                 layerDetails.canScaleSymbols = false;                 layerDetails.copyright = "";                 layerDetails.defaultVisibility = true;                 layerDetails.extent = sfr.extent;                 layerDetails.hasAttachments = false;                 layerDetails.hasLabels = false;                 layerDetails.hasM = layerDetails.hasZ = false;                 layerDetails.isDataVersioned = false;                 layerDetails.spatialReference = spatialReference;                 layerDetails.version = Number.NaN;                 layerDetails.name = sfr.title;                                  var di:DrawingInfo = new DrawingInfo();                 di.alpha = 1;                 if(isLabel){                     const base64Dec:Base64Decoder = new Base64Decoder();                     base64Dec.decode(ANNOTATION);                     di.renderer = new SimpleRenderer(new PictureMarkerSymbol(base64Dec.toByteArray()));                 }else{                     di.renderer = new SimpleRenderer(sfr.symbol);                 }                                  layerDetails.drawingInfo = di;                  return layerDetails;             }

View solution in original post

0 Kudos
4 Replies
BjornSvensson
Esri Regular Contributor
Shapefiles aren't supported in the normal flex viewer. What does the shapefile widget do to display them?  How is the data being sent to the ExportWebMap task? 

Do you have an example REST request, or a working application where it is easy to replicate the problem?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Bjorn,

   The ShapeFileWidget adds Featurelayers that are built client side using a FeatureCollection and the LayerDetails have all of its properties assigned.

Here is a Web_Map_as_JSON for you to look at:

You will see that the Web_Map_as_JSON request has the layer named properly
,"id":"district.zip - district","minScale":0,"title":"district.zip - district","maxScale":0
Yet the output in th legend looks more like a GUID or something "T7e4f154e971c424ca920e05489fa892a".
0 Kudos
BjornSvensson
Esri Regular Contributor
Here is a Web_Map_as_JSON for you to look at:

You will see that the Web_Map_as_JSON request has the layer named properly
,"id":"district.zip - district","minScale":0,"title":"district.zip - district","maxScale":0


Thanks for the sample JSON, it was very helpful 🙂

For feature collections, the Web_Map_as_JSON needs the pretty name to go into the layer, as "name" under "layerDefinition".

..."layerDefinition":{"name":"pretty name","drawingInfo":...


I'm not sure if that something you have to control over, or if it is something that needs to be fixed in the API.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Bjorn,

  In the ShapefileWidget I am already setting the name property of the LayerDetail so it must be a API issue.

            private function creatLayerDetails(sfr:ShapeFileResult, spatialReference:SpatialReference, isLabel:Boolean = false):LayerDetails             {                 var layerDetails:LayerDetails = new LayerDetails();                 layerDetails = new LayerDetails();                 layerDetails.canModifyLayer = false;                 layerDetails.canScaleSymbols = false;                 layerDetails.copyright = "";                 layerDetails.defaultVisibility = true;                 layerDetails.extent = sfr.extent;                 layerDetails.hasAttachments = false;                 layerDetails.hasLabels = false;                 layerDetails.hasM = layerDetails.hasZ = false;                 layerDetails.isDataVersioned = false;                 layerDetails.spatialReference = spatialReference;                 layerDetails.version = Number.NaN;                 layerDetails.name = sfr.title;                                  var di:DrawingInfo = new DrawingInfo();                 di.alpha = 1;                 if(isLabel){                     const base64Dec:Base64Decoder = new Base64Decoder();                     base64Dec.decode(ANNOTATION);                     di.renderer = new SimpleRenderer(new PictureMarkerSymbol(base64Dec.toByteArray()));                 }else{                     di.renderer = new SimpleRenderer(sfr.symbol);                 }                                  layerDetails.drawingInfo = di;                  return layerDetails;             }
0 Kudos