PrintTask line not visible (map.graphics layer)

668
4
Jump to solution
08-20-2012 02:20 AM
MatejSkerjanc
Occasional Contributor
I'm using printtask to make a print of the map.
I add some graphics to map.graphics layer. In case of point or polygon the print task will actually print the result but if its a polyline the result will be only seen on map itself (as per result of map.graphics.add) but not on the printed image/pdf.
I dont think the symbol is wrong since i use same marker for line and polygon...



pointStyle : new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, 20, null, new dojo.Color([255,255,0,0.5]));
linepolyStyle : new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol("dashdot", new dojo.Color([255,0,0]), 5), new dojo.Color([255,255,0,0.25]));


pseudo code
if point{
add graphic to map.graphics
}
else //so if polyline or polygon
{
add graphic to map.graphics
}


Hopefully someone already met and solved this issue:)
0 Kudos
1 Solution

Accepted Solutions
derekswingley1
Frequent Contributor

I dont think the symbol is wrong since i use same marker for line and polygon...


Use a SimpleLineSymbol instead of a SimpleFillSymbol for your line graphic(s).

View solution in original post

0 Kudos
4 Replies
PeterYurkosky1
Occasional Contributor
Can you post the JSON sent from your app to the server? You can pull that out of the request using a tool like Fiddler.
0 Kudos
derekswingley1
Frequent Contributor

I dont think the symbol is wrong since i use same marker for line and polygon...


Use a SimpleLineSymbol instead of a SimpleFillSymbol for your line graphic(s).
0 Kudos
MatejSkerjanc
Occasional Contributor
I was doing this at home and just for kicks tried the base symbol and it worked. So Derek your answer is correct and deserves a tick.
Thank you both.

p.s. i still don't understand why though
0 Kudos
derekswingley1
Frequent Contributor
Glad you got it figured out.

The reason you need to do this is that you have to use different symbol types for different geometry types. Points require a marker symbol, lines require a line symbol and polygons require a fill symbol.
0 Kudos