Select to view content in your preferred language

Print Widget: how to print map with selected parcel highlighted

1099
5
Jump to solution
02-12-2020 04:50 PM
BingJing
New Contributor III

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. 

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

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.

View solution in original post

5 Replies
UriGilad_EsriAu
Esri Contributor

I'm not sure you can print a selection, but what you can do instead:

  1. Replicate the layer in your layer list and make sure it's on top of the original.
  2. Set the symbology of the new layer to be similar to a selection (same area or transparent area, bright blue outline).
  3. Instead of selecting features, apply a filter (through the table or Filter widget) to the new layer. 

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.

RobertScheitlin__GISP
MVP Emeritus

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.

BingJing
New Contributor III

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)

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

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;
          }
        }));
....
0 Kudos
BingJing
New Contributor III

Hi Robert

I found out why. The layer name is different if I turn on the operational layer.. I got it working!. Thank you.

0 Kudos