POST
|
I ended up solving this by making my own customized html page within the onDirectionsFinished function of widget.js of Directions widget. the printresult function is where you can populate a global variable to store the map jpg url //added code............................................................................................
const div = document.createElement('div');
const img = document.createElement('img');
const mapImg = document.createElement('img');
//Had to set a timeout to allow the printtask results time to catch up
const myTimeout = setTimeout(finishhim, 7000);
//Use printtask to get image
var url = 'https://arcgis.com/mapping4/rest/services/Custom_Print_Service/GPServer/Export%20Web%20Map';
var oWid = map.width/2;
var oHgt = map.height/2;
var printTask = new PrintTask(url);
var template = new PrintTemplate();
var br = document.createElement("br");
template.format = "jpg";
template.layout = "MAP_ONLY";
template.preserveScale = true;
template.showAttribution = false;
img.src='https://localhost:3344/webappbuilder/apps/7/widgets/Directions/images/coplogo.png';
var params = new PrintParameters();
params.map = this.map;
params.template = template;
printTask.execute(params, lang.hitch(this, this.printResult));
function finishhim(){
const mapImg2 = document.createElement('img');
div.appendChild(img);
div.appendChild(br);
const p = document.createElement('p');
var x = [];
x.push('<br/>');
div.innerHTML += x;
if (evt.result.routeResults.length > 0) {
const features = evt.result.routeResults[0].directions.features;
count = 0;
features.forEach(function (result, i) {
if (count > 0) {
x.push(result.attributes.text);
div.innerHTML += count + '--' + x[count] + '<br>';
}
count = count + 1;
});
}
mapImg2.src=img2txt;
div.appendChild(mapImg2);
const htmlString = div.outerHTML;
const newWindow = window.open();
newWindow.document.write(htmlString);
}
//............................................................................................................
if(lang.isArrayLike(routeResults) && routeResults.length > 0){
... View more
12-27-2023
03:52 PM
|
0
|
0
|
908
|
POST
|
Hi Robert, this is great to show us how to place addresses labels next to each stop in the route. Maybe I didn't copy the code correctly but I notice I can't use the print button in the Directions widget after pasting your code in Widget.js. Besides that, my real issue is that popup type html page that out of the box directions widget uses. For the life of me, I cannot access/change any of the logo's or text on that special html page from print button in Directions widget. here is my post: Directions Widget, modify Logo at top of Print Res... - Esri Community
... View more
12-18-2023
12:44 PM
|
0
|
0
|
913
|
POST
|
if you are using arcgis pro, you can create your own layouts with logos, etc and publish them to arcgis server using steps like this: https://enterprise.arcgis.com/en/server/latest/publish-services/windows/tutorial-publish-additional-layouts-for-printing-with-arcgis-pro.htm
... View more
12-16-2023
08:44 AM
|
0
|
0
|
429
|
POST
|
this code when added to the index.html is close but it only adds a logo to bottom left of my map. I need to change the logo to the html page where the directions are printed .map .esriMapContainer .esriMapLayers:before {
background-image: url(images/image.png);
background-size: cover;
background-repeat: no-repeat;
position: absolute;
bottom: 2px;
left: 5px;
z-index: 1000;
height: 36px;
width: 148px;
content: ' ';
padding: 0;
}
... View more
12-15-2023
07:00 AM
|
0
|
0
|
1001
|
POST
|
Any ideas anyone? by the way, I'm using LaunchPad theme if that helps any. I've seen a few different examples in the style.css of that theme for different issues others were encountering. I haven't been able to locate that esri logo image itself so I'm wondering if I need to override a setting in that directions widget popup once the print button is clicked to change that logo?
... View more
12-14-2023
12:20 PM
|
0
|
0
|
1029
|
POST
|
I'm using Enterprise 11.1, and some of us are still using Web App builder. My question is specifically on the Directions widget. There is a print button within the widget that puts a generic ESRI logo at top of the results page along with a map and turn by turn directions. I just want to know how to change that ESRI logo to another logo. I've seen @RobertScheitlin__GISP posts on how to change the stop icons in the map results but I can't seem to find the function in Widget.js that handles the popup page of html results for the print job.
... View more
12-13-2023
09:59 AM
|
0
|
3
|
1139
|
POST
|
Hi Robert, I'm using enterprise 11.1 and my question is on the directions widget. It has a print button that puts a basic esri logo at the top of page before printing turn by turn directions. Do you know where I can change that logo to a different one? Thank you in advance
... View more
12-12-2023
02:17 PM
|
0
|
0
|
825
|
POST
|
Greetings, I'm using Experience Builder on Enterprise 11.1. I have a set of features that has a URL to images on one of our vendors sites. Our enterprise is within our firewall so only internal employees can access these applications. However, I have to first log into our vendors website in order to have experience builder embed widget auto show the images from the vendor site. I know its a security risk publicly but could an iframe carry credentials to allow the widget to show the images so other users within our company dont have to log into the vendors site?
... View more
11-15-2023
01:27 PM
|
1
|
0
|
324
|
POST
|
I do not currently have the ArcGIS Interoperability Extension but I'm curious if a .fmw file can be published to ArcGIS Server as a Geoprocess? It seems like it could be possible since the Interoperability Extension can read fme workbench files that it could also publish it to arcgis server. Thoughts? Thank you for any input.
... View more
08-23-2021
01:00 PM
|
0
|
1
|
1417
|
DOC
|
In case anyone is interested, using Robert's idea I modified the code to clear graphics within the onClose function. Add this code to that function this.dynamicGraphic = this.map.getLayer(this.map.graphicsLayerIds[1]); if(this.dynamicGraphic != null) { this.dynamicGraphic.clear(); }
... View more
08-09-2018
10:57 AM
|
0
|
0
|
7235
|
DOC
|
That makes sense but unfortunately I do not have "add to legend" checked which makes this even odder. I'll keep tweaking the code around this area in widget.js and maybe I'll get lucky, thanks
... View more
08-09-2018
05:54 AM
|
0
|
0
|
7235
|
DOC
|
Hi Robert, unfortunately that did nothing to the buffers so I must of missed a step. Below is the onDeactivate function within (server\apps\21\widgets\eSearch\Widget.js). I'm using WAV dev 2.6 I believe and Portal 10.5, AGS 10.5. Is there another js file I need to update this code by chance? After I close the window for the eSearch tool using the upper right X, the buffers I created still remain (screenshot below). Thoughts? onDeactivate: function() { this.graphicsLayerBuffer.clear(); this.drawBox.deactivate(); },
... View more
08-09-2018
05:22 AM
|
0
|
0
|
7235
|
DOC
|
Yes thank you for pointing that out. What is the name of that GraphicsLayer and how would one clear it's graphics? Is the onDeactivate function like I mentioned above a good place to do this? I see that you've used this.graphicsLayerBuffer.clear(); in Widget.js within the _bufferGeometries function. I tried adding that in eith the onClose or onDeactivate functions and no luck so far. Do I need to loop through the graphic container within either of those functions and remove buffers that way?
... View more
08-08-2018
02:13 PM
|
0
|
0
|
7235
|
DOC
|
Hi Robert, will the below code work on your eSearch widget? I'm using multi part graphics and I just want to clear all graphics using the onClose or onDeactivate event. I've tried adding this.map.graphics.clear(); to your onDeactivate function in Widget.js of (server/apps/21/widgets/eSearch) but it's still not clearing the buffers. Thanks for any advice. onDeactivate: function() { this.map.graphics.clear(); this.drawBox.deactivate(); },
... View more
08-08-2018
01:31 PM
|
0
|
0
|
7234
|
POST
|
on the iPhone? I'm just relaying what ESRI mentioned at the PUG conference last week on limitations related to TPK's. This is a good find if true Mark
... View more
05-14-2018
01:03 PM
|
0
|
1
|
1158
|
Title | Kudos | Posted |
---|---|---|
1 | 11-15-2023 01:27 PM | |
1 | 05-02-2017 11:40 AM | |
1 | 06-16-2010 08:09 AM | |
1 | 05-02-2017 10:04 AM |
Online Status |
Offline
|
Date Last Visited |
10-08-2024
01:45 PM
|