|
POST
|
Hi, Here is the code for taking the screenshot of the map. I think you have to use your own hosted layers to get the layers in the screenshot. With this code you can download the image with high resolution. If you want to decrease resolution then you have to the below statements. canvas.toDataURL("image/jpg", 0.5); I can't attach the supported file here so you can download the below mentioned script files from the internet 1. html2canvas.js and html2canvas.svg.js 2. html2proxy.php from the screenshot widget 3. filesaver also from the screenshot widget. <!DOCTYPE html> <html> <head> <title>Test screen shot</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> <link rel="stylesheet" href="https://js.arcgis.com/3.23/esri/css/esri.css"> <style> #tools { top: 20px; color: #444; height: auto; font-family: arial; right: 20px; margin: 5px; padding: 10px; position: absolute; width: 115px; z-index: 40; border: solid 2px #666; border-radius: 4px; background-color: #fff; } html, body, #mapDiv { padding:0; margin:0; height:100%; } button { display: block; } #mapDiv{ height: 100%; } </style> <script type="text/javascript" src="html2canvas.js"></script> <script type="text/javascript" src="html2canvas.svg.js"></script> <script type="text/javascript" src="CanvasToBlob.js"></script> <script type="text/javascript" src="fileSaver.js"></script> <script src="https://js.arcgis.com/3.23/"></script> <script> var map; require([ "esri/map", "esri/layers/ArcGISDynamicMapServiceLayer", "dojo/dom", "dojo/on", "dojo/domReady!" ], function( Map, ArcGISDynamicMapServiceLayer, dom, on ) { map = new Map("mapDiv", { basemap: "streets", center: [-25.312, 34.307], zoom: 3 }); map.on("load", init); var demographicsLayer = new ArcGISDynamicMapServiceLayer("https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer"); map.addLayer(demographicsLayer); function init() { on(dom.byId("screenShotTool"), "click", function(evt) { screenShot(); }); } function screenShot(){ // html2canvas(document.getElementById('mapDiv')).then(function(canvas){ // document.body.appendChild(canvas); //}); html2canvas(document.getElementById("mapDiv_container"), { "logging": true, //Enable log (use Web Console for get Errors and Warnings) "useCORS": true, //"allowTaint": true, "proxy": "html2canvasproxy.php", // "timeout": "0", onrendered: function (canvas) { //document.body.appendChild(canvas); //this.screenshotDataURI = canvas.toDataURL("image/jpg", 0.5); canvas.toBlob(function (blob) { saveAs(blob, "Screenshot.png"); }); } }); } }); </script> </head> <body> <div id="tools"> <button id="screenShotTool">Screen shot</button> </div> <div id="mapDiv"></div> </body> </html> Please let me know if you have any questions. Cheers, Srikanth Dasari
... View more
04-19-2018
11:42 AM
|
3
|
1
|
4055
|
|
POST
|
Please have a look into screenshot widget for the proxy.php in the custom widgets list. Meanwhile, I would like to frame the code properly and will upload the working screenshot widget. Cheers, Srikanth Dasari
... View more
04-18-2018
12:30 PM
|
0
|
3
|
4055
|
|
POST
|
Hi I am just inserting a new record in sharepoint using soap services. As per my request client moved sharepoint application to https. Problem is sharepoint will use credentials to insert a new record and will use NTLM authentication. I hardcoded the credentials in the widget.js file right now. I would like to keep in the proxy.config. Can anyone please tell me how to do that? Cheers, Srikanth Dasari
... View more
04-02-2018
10:01 AM
|
0
|
0
|
815
|
|
POST
|
You have to download the html2canvas.js and html2canvas.svg.js 0.5.0 version files You can attach the source code here so that I would like to take a look...
... View more
03-27-2018
08:40 AM
|
0
|
7
|
4538
|
|
POST
|
You can also use/download custom widget named Screenshot widget from the custom widgets list.. ArcGIS Web Application And you have to use the latest version html2Canvas.js and html2Canvas.svg.js files.. Cheers, Srikanth Dasari
... View more
03-19-2018
03:23 PM
|
1
|
9
|
4538
|
|
POST
|
How to include ArcGIS JS API in Angular JS Application? Cheers, Srikanth Dasari
... View more
03-19-2018
02:20 PM
|
0
|
1
|
1197
|
|
POST
|
03-09-2018
12:07 AM
|
0
|
0
|
7868
|
|
POST
|
SharePoint is only for internal purpose so they are using with http.. On Thu, 22 Feb 2018 at 5:17 pm, Robert Scheitlin, GISP <geonet@esri.com>
... View more
02-22-2018
03:19 PM
|
0
|
1
|
837
|
|
POST
|
Hi, Issue got resolved. Actually, I am using esriRequest for a non-esri "SharePoint" service and I have used dojo/request/xhr to resolve issue. Now, I am facing issue with the mixed content "Mixed Content: The page at 'https://localhost:44397/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'URL'. This request has been blocked; the content must be served over HTTPS" Please give me some resolution. Cheers, Srikanth Dasari
... View more
02-22-2018
02:41 PM
|
0
|
3
|
837
|
|
POST
|
Yes On Wed, 21 Feb 2018 at 2:32 pm, Robert Scheitlin, GISP <geonet@esri.com>
... View more
02-21-2018
04:37 PM
|
0
|
5
|
837
|
|
POST
|
There is a hierarchy in SharePoint.. Website --> List Items (Forms) --> items (Records) In order to create a new record in one of the Form --> https://sp/ops/Portal/_api/Lists/GetByTitle('FormName') --> Will give access to the form--> https://sp/ops/Portal/_api/Lists/GetByTitle("FormName")/items --> Will give access to the records either to create or query Cheers, Srikanth Dasari
... View more
02-21-2018
12:15 PM
|
0
|
7
|
1577
|
|
POST
|
var requestJson = { method: "POST", body: { '__metadata': { 'type': 'SP.Data.Data RequestListItem' }, 'Requestor': 'Test' } //facilities: webMercatorUtils.webMercatorToGeographic(this.geom).x + "," + webMercatorUtils.webMercatorToGeographic(this.geom).y + ";", ////outSR: this.geom.spatialReference.wkid, //token: this.token.token, //defaultBreaks: [this.selectBufferUnits.value], //f: "json" }; esriRequest({ url: "http://sp/ops/Portal/_api/Lists/GetByTitle('ListItem')/items", content: requestJson, handleAs: "json", withCredentials:true }).then(lang.hitch(this, function (response) { this._showError(response); }), function (err) { new Message({ titleLabel: "Warning", message: err.message }); }); Here is the code and getting the error in the console is below. init.js:141 GET https://sp/ops/Portal/_api/Lists/GetByTitle('ListItem')/items?method=POST&body=%5Bobject%20Object%5D net::ERR_CONNECTION_TIMED_OUT l @ init.js:141 b.xhr @ init.js:92 b.xhrGet @ init.js:92 w @ init.js:1010 g @ init.js:1013 A @ init.js:1019 (anonymous) @ init.js:1019 c @ init.js:103 C.then.then @ init.js:105 always @ init.js:112 C @ init.js:1019 _onBtnSubmitClicked @ Widget.js?wab_dv=2.6:102 (anonymous) @ init.js:63 init.js:89 f {message: "Unable to load //sp/ops/Portal/_api/Lists/GetByT…?method=POST&body=%5Bobject%20Object%5D status: 0", response: {…}, status: 0, responseText: "", xhr: XMLHttpRequest, …}
... View more
02-21-2018
11:51 AM
|
0
|
1
|
1577
|
|
POST
|
Even if its a bad practise, Could you please provide the solution??
... View more
02-21-2018
11:37 AM
|
0
|
1
|
1577
|
|
POST
|
I am accessing SharePoint REST Service URL (http) from the application https. Do I need to make SharePoint as a secured one??
... View more
02-21-2018
10:45 AM
|
0
|
1
|
1577
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-02-2023 09:39 PM | |
| 1 | 12-12-2017 11:14 PM | |
| 1 | 05-18-2018 08:06 AM | |
| 1 | 03-19-2018 03:23 PM | |
| 3 | 04-19-2018 11:42 AM |
| Online Status |
Offline
|
| Date Last Visited |
08-19-2025
03:38 PM
|