POST
|
Sorry Denise, I made a typo in the earlier post. print: function () {
var myExtent = this.map.infoWindow.getSelectedFeature()._extent;
this.map.setExtent(myExtent.expand(1.25), true);
setTimeout(function(){
if (this.printSettingsFormDijit.isValid()) {
...
} else {
this.printSettingsFormDijit.validate();
} }.bind(this), 1000); // should be like this }, This should work.
... View more
07-12-2019
03:57 AM
|
1
|
2
|
1071
|
POST
|
Did it work before the final modification to the code? Please post screenshots of the problem areas.
... View more
07-11-2019
02:02 AM
|
0
|
4
|
1071
|
POST
|
Hello Denise, I managed to find an answer to your question using Jeff Pace's answer in this thread: https://community.esri.com/thread/41918 print: function () {
var myExtent = this.map.infoWindow.getSelectedFeature()._extent;
this.map.setExtent(myExtent.expand(1.25), true);
setTimeout(function(){
if (this.printSettingsFormDijit.isValid()) {
...
} else {
this.printSettingsFormDijit.validate();
}
}.bind(this, 1000);
}, Hope this is what you had in mind.
... View more
07-10-2019
04:07 AM
|
1
|
6
|
1011
|
POST
|
Hello Kipo, Sorry for the delay. I have only made changes on Print.js and they are shown on the list above. Please check again. If you can't make it work, feel free to send me with your print.js so I can have a look. Take care.
... View more
06-18-2018
02:03 AM
|
0
|
1
|
1161
|
POST
|
Hello Jeff, You can do something like: this.map.setLevel(this.map.getLevel() + 2);
this.map.centerAt(this.map.infoWindow.getSelectedFeature()._extent.getCenter()); Hope it helps.
... View more
11-30-2017
02:30 AM
|
1
|
9
|
1011
|
POST
|
Create a new folder Copy layout files from C:\Program Files (x86)\ArcGIS\Desktop10.4\Templates\ExportWebMapTemplates to your new folder Go to your new folder and open mxd files on ArcMap Insert menu > Text Right click on Text > Properties > Size and Position > type "TXT1" for "Element Name" Geoprocessing menu > Search For Tools > type "printing" and search > select Printing (Toolset) Get Layout Templates Info (Server) (Tool) > select your new folder > OK Export Web Map (Tool) > "Web Map as JSON" leave it blank > "Output File" leave it as it is > "Format" select a format > "Layout Templates Folder" select your new folder > "Layout Template" select "A4 Landscape" > OK Geoprocessing menu > Results > Current Session > right click on Export Web Map > Share As Geoprocessing Service Add Result > Get Layout Templates Info Publish a service > > > > Publish (it may copy some files to the server) Go to WebAppBuilderForArcGIS/client/stemapp/widgets/Print/Print.js Make the following changes (TXT1 is the element name used in ArcMap, NAME is the field name) // edit start
var cTextElements = [];
var gra = this.map.infoWindow.getSelectedFeature();
var obj = { TXT1: "Name: " + gra.attributes.NAME };
cTextElements.push(obj);
template.layoutOptions.customTextElements = cTextElements;
// edit end
this.printparams.template = template; Make the following changes (to clear selected features when popup window is closed) utils.combineRadioCheckBoxWithLabel(extentRadio, this.printWidgetMapExtentLabel);
// edit start
this.map.infoWindow.on('hide', function () {
this.map.infoWindow.clearFeatures();
});
// end edit ArcGIS Server Manager > Capabilities > URLs > REST URL > Export Web Map > get URL Create a new app > add Print widget > use Export Web Map URL
... View more
12-14-2016
05:23 AM
|
1
|
3
|
1161
|
POST
|
Mission accomplished. this.map.infoWindow.on('hide', function(){
console.info("infoWindow hide event");
this.map.infoWindow.clearFeatures();
}); I am going to prepare a tutorial for printing popup contents soon. Thank you Robert
... View more
11-28-2016
05:30 AM
|
1
|
4
|
1161
|
POST
|
Thank you, but I meant where and can I handle the event when the Popup Window is closed. I tried the ones below but didn't work. map.infoWindow.on('hide', function(){
console.info("infoWindow hide event");
this.map.infoWindow.clearResults();
}); ==================================== dojo.connect(map.infoWindow.hide, "onclick", function () {
console.info("infoWindow hide event");
this.map.infoWindow.clearResults();
});
... View more
11-28-2016
02:43 AM
|
0
|
5
|
1161
|
POST
|
Hello again Robert, var gra = this.map.infoWindow.getSelectedFeature();
var obj = { TXT1: "Name: " + gra.attributes.NAME }; Once a feature is selected, Popup Window is displayed. When Popup Window is closed, feature is no longer selected but the above code still uses the last selected feature. How can I clear getSelectedFeature() when Popup Window is closed?
... View more
11-24-2016
05:47 AM
|
0
|
7
|
1161
|
POST
|
Hello Rich, //Hide map attribution
template.showAttribution = false;
//end my change
template.showLabels = form.showLabels && form.showLabels[0];
template.layoutOptions = {
authorText: hasAuthorText ? form.author : "",
copyrightText: hasCopyrightText ? (form.copyright || this._getMapAttribution()) : "",
legendLayers: legendLayers,
titleText: hasTitleText ? form.title : "",
customTextElements: cteArray
};
// final edit
var cTextElements = [];
var gra = this.map.infoWindow.getSelectedFeature();
var obj = { TXT1: "Name: " + gra.attributes.NAME };
cTextElements.push(obj);
template.layoutOptions.customTextElements = cTextElements;
// edit end
... View more
11-17-2016
10:33 PM
|
1
|
0
|
1031
|
POST
|
Hello Robert, Finally got it working. Thanks a lot for your time.
... View more
11-09-2016
03:35 AM
|
1
|
2
|
1031
|
POST
|
Robert, var gra = this.map.infoWindow.getSelectedFeature();
var obj = {DistrictName: "District Name: " + gra.attributes.NAME};
cTextElements.push(obj);
template.layoutOptions.customTextElements = cTextElements; I am guessing this change still requires layer to be found first? But in my situation, if I use print widget, layer is returned as "undefined" so that portion of the code is not reached.
... View more
11-08-2016
09:47 PM
|
0
|
3
|
1031
|
POST
|
Robert, Here is the latest situation. When I search a parcel from Enhanced Search Widget's Parcels layer, the result is selected and highlighted in red. If I use print widget at this time, NAME attribute of the highlighted parcel is included in the printout. I would like the printout to have the attributes in the popup window when a parcel is selected via mouse click. Any idea how I can achieve this?
... View more
11-07-2016
11:43 PM
|
0
|
21
|
1233
|
POST
|
Robert, WAB 2.2 eSearch 2.1 Chrome: 54.0.2840.87 m Firefox: 49.0.2
... View more
11-07-2016
09:09 PM
|
0
|
22
|
1233
|
Title | Kudos | Posted |
---|---|---|
1 | 11-04-2016 05:25 AM | |
1 | 11-28-2016 05:30 AM | |
1 | 12-14-2016 05:23 AM | |
1 | 11-30-2017 02:30 AM | |
1 | 07-10-2019 04:07 AM |
Online Status |
Offline
|
Date Last Visited |
05-10-2024
05:41 PM
|