POST
|
Thanks for your replies, Jeff and Ralph. Ralph, I have already tried this method, the dynamic map displays on the page, however I wanted to amend the basemap property in the map object, so that instead of using ArcGISOnline pre-defined maps, my dynamic map services are used as a basemap. Jeff, I will have a look at the class definitions and see if I can make sense of it.
... View more
03-27-2014
03:02 AM
|
0
|
0
|
260
|
POST
|
Does anyone know how to amend the basemap option below, so that I can add a dynamic map service (...../mapserver) instead of the ArcGISonline map? I know about e.g. map.addLayers(dynamicMapService), however I want to see if there is a a way to amend the below. map = new Map("map", { basemap: "topo" }
... View more
03-26-2014
08:48 AM
|
0
|
3
|
666
|
POST
|
With regard to the answer Dave gave on the following forum: http://gis.stackexchange.com/a/74170/124 How do I use a dynamic service in this solution? I am trying to toggle the basemap with a dynamic service, or toggle 2 dynamic services, rather than a tiled basemap. I aim to do to a dynamic service, what the following esri sample is doing to an arcgisonline map: https://developers.arcgis.com/javascript/jssamples/widget_toggle.html Any ideas?
... View more
03-26-2014
06:49 AM
|
0
|
0
|
555
|
POST
|
I need to create a toolbar, similar to the one on Google Maps, where you can zoom in and out, pan in all directions and also go back to default extent. Does anyone know where I can get the dijit etc? Thanks, Saqib.
... View more
01-28-2014
02:37 AM
|
0
|
1
|
643
|
POST
|
Thanks for your reply Jeff, just another basic question, in Legacy code where a dojo.require declaration is made, e.g. dojo.require("esri.map"); If I have the legacy dojo.require in one js file and in my AMD migration js file I have require(["esri/map",.....], function()....) is it ok to have two calls like this to esri.map, since both js files are serving one site. In the AMD the esri.map object is only available to the function, whereas when it is globally declared in the dojo.require(), this is global to my application?? In my project the two calls work simultaneously, I am trying to find out the best working method and so that I stick to the standard way of doing things.
... View more
11-29-2013
05:51 AM
|
0
|
0
|
340
|
POST
|
Can AMD Module Require code be used with Legacy Module Require Code, or do you need to convert AMD to Legacy or vice versa?
... View more
11-25-2013
02:07 AM
|
0
|
3
|
612
|
POST
|
Finally it is working! The proxy.ashx files was finally located and after the amendment was made in the proxy.config file, printing started to work in my project on IE, FireFox, Safari and Chrome! Many thanks @John, @Don and @Chris for your help and contributions. 🙂 Saqib.
... View more
11-06-2013
05:34 AM
|
0
|
0
|
624
|
POST
|
John, I have used your link (http://localhost/proxy/proxy.ashx?http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task?f=json) and in the attached are the results I'm getting in Chrome. I have also replaced from sampleserver6 to Task with my own print task and the same results are retrieved as the attachment. Does this mean the proxy is defined and fully working? If so, how do I get this to work with my own site? I think more specifically my question is how do I find out which external url is the same as http://localhost/ ? The URL I thought localhost/proxy/proxy.ashx was pointing to doesn't exist externally. Our IT people don't have a clue either! Additionally, when I try your url (http://localhost/proxy/proxy.ashx?http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task?f=json) from my machine, the attachment is what I get, when I try your url from a "test" server, I get a 403 forbidden error and from the "live" server I get a 404 not found in the Network stats.
... View more
11-04-2013
11:54 PM
|
0
|
0
|
624
|
POST
|
Hi John, I checked the Network stats in my local project and similar to your link my proxy link was not going through, as a test I changed all my URL's to point internally at the local server, hence bypassing the proxy and it worked. The next step is I need to find out how to check my proxy is working, is there an easy way to tell the proxy page works, or if it is even defined? Thanks, Saqib.
... View more
11-04-2013
07:17 AM
|
0
|
0
|
946
|
POST
|
John, When I go to http://localhost/proxy/proxy.ashx?http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task?f=json and look through the Network tab in Chrome, I receive three Get methods. I get a success on the (first) text/html file, on the second (default.css) I get a 304 Not modified and lastly a 204 No Content. I have attached a screenshot to make this point more clear. Is this what you're expecting?
... View more
11-04-2013
01:24 AM
|
0
|
0
|
946
|
POST
|
Hi Nick, Many thanks for replying. I have in my own personal project replaced all the URL's for my local ArcGIS server, including the print task, exactly the same thing occurs, when I put in an alert box the Print appears and it breaks when I comment out the alert box. This only works in FireFox, it doesn't work on any other browser (I've tried Chrome, IE and Safari). I was thinking if I could get the above code to work, I can apply these principles to my local project. Thanks, Saqib.
... View more
10-31-2013
12:36 PM
|
0
|
0
|
946
|
POST
|
When I use the ESRI sample Print templates with esri.request (https://developers.arcgis.com/en/javascript/jssamples/widget_print_esri_request.html), I copy the code into a local html file, the "print" button doesn't display, however when I put an alert box in line 79, this somehow causes it to work in FireFox. To make debugging easier, I have replaced the original console.log() method to alert(). Any ideas? <!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> <title></title> <link rel="stylesheet" href="http://js.arcgis.com/3.7/js/dojo/dijit/themes/tundra/tundra.css"> <link rel="stylesheet" href="http://js.arcgis.com/3.7/js/esri/css/esri.css"> <style> html, body { height: 100%; width: 100%; margin: 0; padding: 0; } h3 { margin: 0 0 5px 0; border-bottom: 1px solid #444; padding: 0 0 5px 0; text-align: center; } .shadow { -moz-box-shadow: 0 0 5px #888; -webkit-box-shadow: 0 0 5px #888; box-shadow: 0 0 5px #888; } #map{ margin: 0; padding: 0; } #feedback { background: #fff; color: #000; position: absolute; font-family: arial; height: auto; right: 20px; margin: 5px; padding: 10px; top: 20px; width: 300px; z-index: 40; } #feedback a { border-bottom: 1px solid #888; color: #444; text-decoration: none; } #feedback a:hover, #feedback a:active, #feedback a:visited { border: none; color: #444; text-decoration: none; } #note { font-size: 80%; font-weight: 700; padding: 0 0 10px 0; } #info { padding: 10px 0 0 0; } </style> <script src="http://js.arcgis.com/3.7/"></script> <script> var app = {}; require([ "esri/map", "esri/layers/FeatureLayer", "esri/dijit/Print", "esri/tasks/PrintTemplate", "esri/request", "esri/config", "dojo/_base/array", "dojo/dom", "dojo/parser", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dojo/domReady!" ], function( Map, FeatureLayer, Print, PrintTemplate, esriRequest, esriConfig, arrayUtils, dom, parser ) { parser.parse(); app.printUrl = "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"; esriConfig.defaults.io.proxyUrl = "/proxy"; app.map = new esri.Map("map", { basemap: "hybrid", center: [-117.447, 33.906], zoom: 17, slider: false }); // add graphics for pools with permits var permitUrl = "http://sampleserver6.arcgisonline.com/arcgis/rest/services/PoolPermits/MapServer/1"; var poolFeatureLayer = new FeatureLayer(permitUrl, { "mode": FeatureLayer.MODE_SNAPSHOT }); alert("Test"); // This is Line 79 ! This will work in FireFox, after commenting out, it will break app.map.addLayer(poolFeatureLayer); // get print templates from the export web map task var printInfo = esriRequest({ "url": app.printUrl, "content": { "f": "json" } }); printInfo.then(handlePrintInfo, handleError); function handlePrintInfo(resp) { var layoutTemplate, templateNames, mapOnlyIndex, templates; layoutTemplate = arrayUtils.filter(resp.parameters, function(param, idx) { return param.name === "Layout_Template"; }); if ( layoutTemplate.length == 0 ) { alert("print service parameters name for templates must be \"Layout_Template\""); return; } templateNames = layoutTemplate[0].choiceList; // remove the MAP_ONLY template then add it to the end of the list of templates mapOnlyIndex = arrayUtils.indexOf(templateNames, "MAP_ONLY"); if ( mapOnlyIndex > -1 ) { var mapOnly = templateNames.splice(mapOnlyIndex, mapOnlyIndex + 1)[0]; templateNames.push(mapOnly); } // create a print template for each choice templates = arrayUtils.map(templateNames, function(ch) { var plate = new PrintTemplate(); plate.layout = plate.label = ch; plate.format = "PDF"; plate.layoutOptions = { "authorText": "Made by: Esri's JS API Team", "copyrightText": "<copyright info here>", "legendLayers": [], "titleText": "Pool Permits", "scalebarUnit": "Miles" }; return plate; }); // create the print dijit app.printer = new Print({ "map": app.map, "templates": templates, url: app.printUrl }, dom.byId("print_button")); app.printer.startup(); } function handleError(err) { alert("Something broke: ", err); } }); </script> </head> <body class="tundra"> <div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'headline',gutters:false" style="width: 100%; height: 100%; margin: 0;"> <div id="map" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'"> <div id="feedback" class="shadow"> <h3> Print Templates Created from Info Returned by the Print Service using <a href="https://developers.arcgis.com/en/javascript/jsapi/namespace_esri.html#request">esri.request</a> </h3> <div id="info"> <div id="note"> Note: This sample uses an ArcGIS Server version 10.1 export web map task. </div> <!-- that will be used for the print dijit --> <div id="print_button"></div> <div id="info"> <a href="https://developers.arcgis.com/en/javascript/jsapi/printtemplate.html">Print templates</a> are generated from the Export Web Map Task's <a href="http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task">Layout_Template parameter</a>. This info is retrieved from the service using <a href="https://developers.arcgis.com/en/javascript/jsapi/namespace_esri.html#request">esri.request</a>. </div> </div> </div> </div> </div> </body> </html>
... View more
10-31-2013
08:13 AM
|
0
|
16
|
2605
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|