I have a custom print service task published on portal, now I can print attributes, but how can I make the printed map have my search results parcel selected on map?
After the search, the parcel is selected/highlighted, but when I click on print widget, the eSearch widget is closed, and the parcel's highlighted boundary is gone.
Solved! Go to Solution.
Printing the search results using the eSearch widget is a simple configuration option. In the eSearch widgets configuration for that layer make sure you select/check the "Add result as operational layer". This way when the widget is closed the layer does not get cleared from the map unless you specifically clear the search results.
I'm not sure you can print a selection, but what you can do instead:
Now you will have your original layer showing the same, and the new layer on top will show only the filtered features with selection-like colors.
Printing the search results using the eSearch widget is a simple configuration option. In the eSearch widgets configuration for that layer make sure you select/check the "Add result as operational layer". This way when the widget is closed the layer does not get cleared from the map unless you specifically clear the search results.
Hi Robert
When I turn on "Add result as operational layer", The parcel is highlighted in the generated PDF to print, which is great!
But the customTextElements are gone because the eSearch widget's graphicsLayer in print.js is unavailable.
What could I have done wrong? (I am using your eSearch 2.9, from 2/2019)
Leo,
So it sounds like you have made a customization to the print.js file based on one of my other threads that allows you to use custom text elements in your print layout. Line 5 below it is search for the eSearch widgets "Search Results: Parcels" Where Parcels is the name of the eSearch search layer. It sounds like your code is not finding the layer name that you have in your code.
//See if there is a parcel search layer added to the map
var plyr;
array.some(this.map.graphicsLayerIds, lang.hitch(this, function (layerId) {
var lyr = this.map.getLayer(layerId);
if(lyr.name === "Search Results: Parcels"){
plyr = lyr;
return true;
}
}));
....
Hi Robert
I found out why. The layer name is different if I turn on the operational layer.. I got it working!. Thank you.