Print widget not working with Print Symbol.

280
2
02-13-2019 04:32 AM
ADITYAKUMAR1
Occasional Contributor II

Hi,

  I have a Picturemarker. When I am trying to print along with the symbol my Print is failing.While printing without the symbol is working. Any clue about this behavior?

var point = evt.mapPoint;
let parent = this;
var xhr = new XMLHttpRequest();
xhr.open("GET", "https://www.tutorialspoint.com/videotutorials/images/tutor_connect_home.jpg", true);
xhr.responseType = "blob";
xhr.onload = function (e) {
console.log(this.response);
var reader = new FileReader();
let parent1 = parent;
reader.onloadend = () => {
//reader.onload = function (event) {
var res = reader.result;
console.log(res.split(',')[1]);

res = res.split(',')[1];

var point = evt.mapPoint;
var stopSymbol = new PictureMarkerSymbol({ "type": "esriPMS", "width": 31, "height": 31, "imageData": res, "angle": 0, "xoffset": 0, "yoffset": 0 });
var stop = parent1.map.graphics.add(new Graphic(point, stopSymbol));
pxWidth = parent1.map.extent.getWidth() / parent1.map.width;
padding = 3 * pxWidth;
qGeometry = new Extent({
"xmin": point.x - padding,
"ymin": point.y - padding,
"xmax": point.x + padding,
"ymax": point.y + padding,
"spatialReference": point.spatialReference
});

topic.publish("mapClick", { X: point.x, Y: point.y });

};
var file = this.response;
reader.readAsDataURL(file)

};
xhr.send()

Error: 

Thanks

Aditya Kumar

0 Kudos
2 Replies
Noah-Sager
Esri Regular Contributor

Hi ADITYA KUMAR, which version of the JS API are you using?

0 Kudos
ADITYAKUMAR1
Occasional Contributor II

Hi Noah,  

   I am working on Javascript api 3.19.

0 Kudos