Hey guys, I am making a measurement app, and I am adding the measurements on every click as a graphic(point, textSymbol) and I am setting the color to white. Now on the map it shows up as white, but when I print the result, the measurement text comes out black. Cant seem to figure out whats going on, any ideas?
Solved! Go to Solution.
I've seen this sort of thing happen before when working with fonts. I downloaded your code and rewrote the part that creates the text symbols. Using the verbose method of creating the symbol fixed the issue for me. This is the code I used:
var font = new Font();
font.setSize("15pt");
font.setWeight(Font.WEIGHT_BOLDER);
font.setFamily("Candara");
var color = new Color();
color.setColor([255, 255, 255]);
var textSymbol = new TextSymbol()
textSymbol.setText(zero.toFixed(1).toString()+"'");
textSymbol.setFont(font);
textSymbol.setColor(color);
textSymbol.setAlign(Font.ALIGN_MIDDLE);
textSymbol.setAngle(0);
totalLength += zero;
mx = (parseFloat(x1)+parseFloat(x))/2;
my = (parseFloat(y1)+parseFloat(y))/2;
var labelPoint = new Point(mx,my);
var labelPointGraphic = new Graphic();
labelPointGraphic.setGeometry(labelPoint);
labelPointGraphic.setSymbol(textSymbol);
I've seen this sort of thing happen before when working with fonts. I downloaded your code and rewrote the part that creates the text symbols. Using the verbose method of creating the symbol fixed the issue for me. This is the code I used:
var font = new Font();
font.setSize("15pt");
font.setWeight(Font.WEIGHT_BOLDER);
font.setFamily("Candara");
var color = new Color();
color.setColor([255, 255, 255]);
var textSymbol = new TextSymbol()
textSymbol.setText(zero.toFixed(1).toString()+"'");
textSymbol.setFont(font);
textSymbol.setColor(color);
textSymbol.setAlign(Font.ALIGN_MIDDLE);
textSymbol.setAngle(0);
totalLength += zero;
mx = (parseFloat(x1)+parseFloat(x))/2;
my = (parseFloat(y1)+parseFloat(y))/2;
var labelPoint = new Point(mx,my);
var labelPointGraphic = new Graphic();
labelPointGraphic.setGeometry(labelPoint);
labelPointGraphic.setSymbol(textSymbol);
Thanks, its been driving me crazy since everything looked correct. Your suggestion worked perfectly!
Hi
I have same problem with textsymbol in printing layout. No matter what color i use, the printing map symbols always still black.
I try the example but not working. zero not defined.
You can send more code for this?
thanks
Joao