Various problems with the map-tools-template for web map applications

2333
1
09-29-2015 10:00 AM
Jay_Gregory
Occasional Contributor III

I recently downloaded the map-tools-template from Esri/map-tools-template · GitHub  and configured defaults.js to connect to my 10.3 Portal for ArcGIS Instance and a web map I had created earlier (i'm hosting the application on a entirely separate web server).  Most of the core functionality works great, but I have some problems when trying to enable some enhanced features.

1: Print task - the print task executes successfully using our internal Export Web Map Task - if I check response in the Chrome console, I can see the uri for the resultant pdf (ie,https://ourgisserver.domain.com/arcgis/rest/directories/arcgisoutput/Utilities/PrintingTools_GPServe...). However, the app doesn't automatically download the pdf. At some point in the JS, window.location would have to be set to the uri for the pdf but that doesn't seem to happen and the casual user does not get the pdf....

2. Table view: I can't seem to control the table view.  In defaults.js, there is a tableLayer object with id and fields parameters, but no matter what I put in there, I can't seem to control what appears in the table view (right now it is arbitrarily the 9th layer in my map).  I also don't know what to put for the tableLayer id attribute (the name of the layer in the web map?  I can't seem to find any "layer id" associated with layers in a Portal web map).

3. Search layers: in addition, I can't seem to control the searchLayers function.  The search function works well on my various locators I've configured with portal, but I can't figure out how to include an attribute from one or more of my layers in the search query.  Again, in defaults.js there is a searchLayers object with id and fields attributes, but if I add anything to this section, it breaks the entire search box.  In addition, editing the web map properties itself to Search by Layer also breaks the search functionality in my application.  

If anyone has any tips on how to make these features work, please let me know!

Thanks so much!

0 Kudos
1 Reply
TimMinter
Occasional Contributor III

I'm working on your item #3 for my own needs.  I thought I would configure the template app in AGO, then figure out how to snag the default.js file and grab the config settings from it (Google Chrome F12 tool).  haven't figured it out yet, but I only spent about 20 minutes after reading the instructions before I ran out of time.  Maybe more later.

0 Kudos