Basic map page script

This script is used to display all active, critical incident locations.

//setup new GlideRecord query on the incident table
var gr = new GlideRecord("incident");
//add condition for priority 1
gr.addQuery('priority', '1');
//add condition for active incidents
//execute the query
//loop through the list of incidents returned by the query
while ( {
 //create a new map item to display - linked to the current incident record
 var item = map.addItem(gr);
 //add the latitude value from the incident's location
 item.latitude = gr.location.latitude;
 //add the longitude value from the incident's location
 item.longitude = gr.location.longitude;
 //add the incident number to the dialog title
 item.dialog_title = gr.getDisplayValue();
 //link to the icon image
 item.icon = "";
 //set the icon size
 item.icon_width = "16";
 item.icon_height = "16";