Display incidents in a Map view.

Munna1
Tera Contributor

Hello,

 

Here I am trying to view multiple incidents  with the below script. But it is showing only one incident . can anyone help me on this please..

 

var gr = new GlideRecord("incident");
gr.addQuery('priority', '1');
gr.addActiveQuery();
gr.query();
while (gr.next()) {
if (gr.location.latitude && gr.location.longitude) {
var item = map.addItem(gr);
item.latitude = String(gr.location.latitude);
item.longitude = String(gr.location.longitude);
item.dialog_title = gr.getDisplayValue();
item.icon = "https://maps.google.com/mapfiles/kml/pal3/icon51.png";
item.icon_width = "32";
item.icon_height = "32";
}
}

 
Thanks,
2 REPLIES 2

Mark Manders
Mega Patron

It would really help if you not just repeat your question over and over again, but also mention what you already tried and what others provided you as solution (including what didn't work from those suggestions).


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark