/ add graphics for pools with permits // I NEED SOMETHING HERE TO CREATE A PRINT MAP, I CAN CREATE A MAP SERVIC WITH A BLANK MAP var permitUrl = "http://tfsgis-iisd01:6080/arcgis/rest/services/FeatureServiceStewAAreaAPoint/MapServer/2"; var poolFeatureLayer = new FeatureLayer(permitUrl, { "mode": FeatureLayer.MODE_SNAPSHOT, visible:false }); app.map.addLayer(poolFeatureLayer); // get print templates from the export web map task var printInfo = esriRequest({ "url": app.printUrl, "content": { "f": "json" } }); printInfo.then(handlePrintInfo, handleError); function handlePrintInfo(resp) { var layoutTemplate, templateNames, mapOnlyIndex, templates; layoutTemplate = arrayUtils.filter(resp.parameters, function(param, idx) { return param.name === "Layout_Template"; }); 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); } // create a print template for each choice templates = arrayUtils.map(templateNames, function(ch) { var plate = new PrintTemplate(); plate.layout = plate.label = ch; plate.format = "PDF"; plate.layoutOptions = { "authorText": "Texas A&M Forest Service", "legendLayers": [], "titleText": "Activity Point", "scalebarUnit": "Miles" }; return plate; }); // create the print dijit app.printer = new Print({ "map": app.map, "templates": templates, url: app.printUrl }, dom.byId("print_button")); app.printer.startup(); } function handleError(err) { console.log("Something broke: ", err); } featuremapServiceSource = "http://tfsgis-iisd01:6080/arcgis/rest/services/FeatureServiceStewAAreaAPoint/FeatureServer/"; var stewardship = new esri.layers.FeatureLayer(featuremapServiceSource + "/" + 0, { mode: FeatureLayer.MODE_SELECTION, id: 'stewardship', outFields: ['*'] }); app.map.addLayers(stewardship); var highlightSymbol = new esri.symbol.SimpleMarkerSymbol().setColor(new dojo.Color([255,255,0,.6])); highlightSymbol.setSize(9) stewardship.setSelectionSymbol(highlightSymbol); // I NEED THIS TO RUN THE GP SERVICE, THIS IS TO HAVE GRAPHICS ON THE MAP var petroFieldsMSL = new ArcGISDynamicMapServiceLayer("http://tfsgis-iisd01:6080/arcgis/rest/services/FeatureServiceStewAAreaAPoint/MapServer/"); petroFieldsMSL.setDisableClientCaching(true); //When I add this the printing dijit stops working app.map.addLayer(petroFieldsMSL); // So not to have another layer besides stewardship petroFieldsMSL.setVisibleLayers([0]) dojo.connect(app.map, 'onLoad', function(map) { initToolbar(app.map); });
Solved! Go to Solution.