As it seems now it's the reversed order.
Order means: it doesn't matter, where you define the layer , the important thing is when you set the map-property of the layer.
So when you set the map-property of a layer this layer will be covered by the other layers.
Currently you first set the map for riverBasins/counties in toggleLayers, then you call setQuery where you set the map for apps(the dots):
lyr.apps.setMap(null);
lyr.apps.setMap(gmap);
apps always will be covered by riverBasins/counties, because it's map-property has been set finally
Possible workaround:
After setting the map-property for apps set the maps-property for riverBasins/counties again:
fn.setQuery = function () {
lyr.apps.query.where = ' BUS_UNIT_CODE IN (\'x\'' + buCodeList + ')';
if (searchFilter && searchFilter !== '') {
lyr.apps.query.where += ' AND ' + searchFilter;
}
lyr.apps.setMap(gmap);
lyr.counties.setMap(lyr.counties.getMap());
lyr.riverBasins.setMap(lyr.riverBasins.getMap());
};
But maybe this is only a temporary behaviour, I don't think that this is a intended modification(at least it doesn't make any sense). I guess it's more a undesired side-effect of another modification and they will fix it soon.