POST
|
Hi Mudit, I've added the Bing map as a separate basemap layer and I get the following message in console: "NetworkError: 500 ConnectFailure - http://vmgisapp02/proxy/proxy.ashx?http://dev.virtualearth.net/REST/v1/Imagery/Metadata/road?key=AnHHQLAySlpOjUvWIR_0e0W5lGWHLdv91F_Vqp_GDFvV1xmSmYEV0kKT5x24-x66&ss=true&c=en-US&include=imageryProviders&jsonp=dojo.io.script.jsonp_dojoIoScript20._jsonpCallback" I get the same error when I put the double url in my browser, in this case I checked my proxy.config file and the virtual earth url is already present "http://dev.virtualearth.net/REST/" The problem is obviously Bing isn't allowed through proxy. I also added the following line "esri.config.defaults.io.alwaysUseProxy = true;" to the code, setting the variable to false ends up giving me a CORS error. Regards, Saqib.
... View more
06-13-2014
06:49 AM
|
0
|
0
|
355
|
POST
|
I have realised all my code is "correct", the problem it seems is not in my code but in which basemap I am using. We are using Bing basemapping, when I switch this off, the printing functions correctly. Is there anything I can do to allow Bing basemaps to print?
... View more
06-13-2014
02:12 AM
|
0
|
0
|
355
|
POST
|
I am using IIS 6.0 In the console, when it refers to InfoWindow.js it can't find it, maybe in the html the directory structure is odd? Since InfoWindow.js is loaded through dojoConfig, I have taken the javascript file declaration out:
<script type="text/javascript">
var dojoConfig = {
parseOnLoad : false,
async : false,
packages : [ {
name : "myModules",
location : location.pathname.replace( /\/[^/]+$/, "/myModules")
} ] };
</script>
... View more
06-10-2014
11:14 PM
|
0
|
0
|
211
|
POST
|
I had a legacy ESRI JS site, I have now upgraded this to include the latest AMD and ESRI JS API. All the files are stored in a folder called "site", in a browser, when I type "http://site/gis.html" ("gis.html" was added in the site properties in IIS), the new AMD site loads with no errors and functions perfectly in all browsers, Firefox, IE, Chrome. When "http://site/" is typed part of the page loads, without the map etc and displays the following errors in the console: "NetworkError: 504 Unknown Host - http://infowindow.js/" --------------------------- infowindow.js Error: scriptError ------------------------------------------------------------------- init.js (line 15) ...a){return"[object Array]"==r.call(a)},f=function(a,c){if(a)for(var d=0;a ;)c(a... src: dojoLoader -------------------------------------------------------------------- init.js (line 41) info: ["//InfoWindow.js", error ] ----------------------------------------------------- init.js (line 41) . ---------------------------------------------------------------------------------- init.js (line 41) As a test, I copied the old site over and just typing "http://site/" and this as expected calls the "gis.html" file and the whole site loads.
... View more
06-10-2014
02:15 AM
|
0
|
2
|
452
|
POST
|
The following is the JavaScript function: function Print() {
var app = {};
require([
"esri/map", "esri/layers/FeatureLayer", "esri/layers/ArcGISDynamicMapServiceLayer",
"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, ArcGISDynamicMapServiceLayer,
Print, PrintTemplate,
esriRequest, esriConfig,
arrayUtils, dom/*, parser*/
) {
//parser.parse();
app.printUrl = "http://www.mapping2.cityoflondon.gov.uk/arcgis/rest/services/Printing/ExportWebMap/GPServer/Export%20Web%20Map";
esriConfig.defaults.io.proxyUrl = "http://vmgisapp02/proxy/proxy.ashx";
app.map = map;
/*
app.map = new esri.Map("map");
var permitUrl = "http://vmgisapp03/arcgis/rest/services/Test4YellowLines/MapServer/0";
var poolFeatureLayer = new FeatureLayer(permitUrl, {
"mode": FeatureLayer.MODE_SNAPSHOT
});
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;
});
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);
}
});
} When this function is outputted on a html map page, I get Cross Origin errors, these don't stop the code from working?? ( Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://vmgisapp03/arcgis/rest/services/Printing/ExportWebMap/GPServer/Export%20Web%20Map/execute. This can be fixed by moving the resource to the same domain or enabling CORS. ) The following error is more worrying: POST http://www.mapping2.cityoflondon.gov.uk/arcgis/r...ExportWebMap/GPServer/Export%20Web%20Map/execute Aborted 60s init.js (line 157) RequestTimeoutError: Timeout exceeded ...g"],function(b){return function(m,e,p,n){p=p||Error;var k=function(b){if(p===Err... I have tested the line.... "app.map = map;" When I comment out "app.map = map;" and uncomment the code block below it, everything works fine. The line "app.map=map;" is taking the existing map object from another JS file elsewhere. It would be great to hear your thoughts. Thanks, Saqib.
... View more
06-05-2014
06:34 AM
|
0
|
3
|
2994
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|