﻿function refreshRoadNetwork() {

    //We initialize the array using the array() constructor.
    var mapguideGroupName = new Array();

    mapguideGroupName[0] = "Road Network - Hansen";
    mapguideGroupName[1] = "Road Network - Class";
    mapguideGroupName[2] = "Road Network - Surface";
    mapguideGroupName[3] = "Road Network - MPMA";
    //mapguideGroupName[4] = "Road Work";

    var counter = 0;

    //Let's loop through the mapguide group layer name elements of the array.
    for (counter = 0; counter < mapguideGroupName.length; counter++) {


        var theMap = top.opener.top.mapFrame.getMap();
        var roadNetworkLayers = theMap.getMapLayerGroup(mapguideGroupName[counter]).getMapLayers();

        var numberOfLayersInGroup = roadNetworkLayers.size();
        var i = 0;
        for (i = 0; i < numberOfLayersInGroup; i++) {
            roadNetworkLayers.item(i).setRebuild(true);
        }
        var theSelection = theMap.getSelection();

        theSelection.clear();
        theMap.refresh();
    }
    top.focus();
}




