AnsweredAssumed Answered

Printer Widget change the Legend element of the  Layout Options with images

Question asked by Mehretab on Feb 7, 2018
Latest reply on Feb 7, 2018 by rscheitlin

I am developing an application based on WAB. Since I have some services with complicated legend I made the legend widget to reference to a pre made images for legend.

 I have my own print template with Title, Author, copyright and legend elements.  I am working to include these images in the place of the legend element or any other element so that the map got an appropriate legend element in the printout. 

If you see the PrintTemplate() object we have access to these layout elements in the  LayoutOptions object as properties. 

// this script is a piece from the print.js 

template.layoutOptions = {
          authorText: hasAuthorText ? form.author : "",
          copyrightText: hasCopyrightText ? (form.copyright || this._getMapAttribution()) : "",
          legendLayers: this._getLegendLayers(), // fix issue 7744
          titleText: hasTitleText ? form.title : "",
          customTextElements: cteArray
        };

the layout elements (authorText, copyrightText, titleText....) are taking their values from the form or we can hardcode the value here. Is there a way then to place my image in any of these elements based on which layer is visible in the map for printing? the hardest thing i experienced is to access the node (the physical places) where these elements are appended in to the print template .  Any Idea is appreciated. 

 

Mehretab

Outcomes