Select to view content in your preferred language

Graphics not rendering until zoom

512
0
02-15-2019 08:54 AM
MiroslavMatovic
New Contributor II

I am using ArcGIS API for JavaScript 4.10 and I am adding point graphics to a map view using view.graphics.addMany() and passing in an array of graphics. However, when my map displays, the graphics aren't showing. Clicking on them shows that graphics are present, and that clicking hits them, they are just not visible. They only become visible after I use zoom in or out. This happens in both Chrome and Firefox browsers.

Code that adds graphics:

var caseGraphics = [];

caseList.forEach(function(oneCase) {
var point = {
type: "point",
longitude: oneCase.Location__Longitude__s,
latitude: oneCase.Location__Latitude__s
};
var pointGraphic = new Graphic({
geometry: point,
symbol: createSymbol()          // symbol is type: "picture-marker"

// popupTemplate also present. removed for brevity
});

caseGraphics.push(pointGraphic);
});

view.graphics.addMany(caseGraphics);

How can I fix this so that graphics always render correctly?

0 Kudos
0 Replies