if( layoutTemplate.length ===0){ console.log("print service parameters name for templates must be \"Layout_Template\"");return;} templateNames = layoutTemplate[0].choiceList;

// remove the MAP_ONLY template then add it to the end of the list of templates mapOnlyIndex = arrayUtils.indexOf(templateNames,"MAP_ONLY");if( mapOnlyIndex >-1){var mapOnly = templateNames.splice(mapOnlyIndex, mapOnlyIndex +1)[0]; templateNames.push(mapOnly);}