POST
|
I haven't been able to figure out the null origin either. The application is a GP Python tool on our Arc GIS server. Here's what I see. The status code is 200 (meaning the report already exists), but it's still generating the report. I added this line to the JS, and it didn't change anything http.setRequestHeader('Access-Control-Allow-Origin', '*'); Request URL: http://ourserver.com/PDF_Reports/Top_Countries/Location_Forecast_Report.pdf Request Method: OPTIONS Status Code: 200 OK Remote Address: 173.164.26.221:80 Referrer Policy: no-referrer-when-downgrade Response Headersview source Allow: OPTIONS, TRACE, GET, HEAD, POST Content-Length: 0 Date: Mon, 06 Nov 2017 21:46:20 GMT Public: OPTIONS, TRACE, GET, HEAD, POST Server: Microsoft-IIS/8.5 X-Powered-By: ASP.NET Request Headersview source Accept: */* Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.8 Access-Control-Request-Headers: access-control-allow-headers,access-control-allow-origin Access-Control-Request-Method: HEAD Connection: keep-alive Host: ourserver.com Origin: null User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
... View more
11-06-2017
01:49 PM
|
0
|
1
|
17787
|
POST
|
OK. I changed the code and clicked on a location that already has a report. I got this error and it proceeded to generate the report again. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
... View more
11-06-2017
12:59 PM
|
0
|
3
|
17787
|
POST
|
I changed the async from false to true and that helped. How would you suggest I change this portion of the script to use esri/request? I need it to check to see if the report exists already at the URL, and if so, return it. If not, run the gp_report tool. Right now it's just generating reports regardless. According to the API reference, request can handle plain text, XML, JSON, and JSONP. Is it restricted to those, or can I retrieve a PDF as well?
... View more
11-06-2017
12:20 PM
|
0
|
5
|
17787
|
POST
|
Hi Victor, 1. Yes, they are on the same Windows Server 2012 machine. 2. Allowed origins is set to "*". I tried adding the URL of our webserver and it didn't help. 3. I wrote everything in ArcGIS-JS-API, yes. No WAB. I think the section that's causing all the errors is below. This checks to see if the report has already been generated, and if so, returns it to the popup. If I uncomment line 6, it doesn't help. var http = new XMLHttpRequest();
var contentResult = "";
http.open('HEAD', reportPath, false);
//http.setRequestHeader('Access-Control-Allow-Headers', '*');
http.send();
//console.log(http.status);
if(http.status === 200){
contentResult ='<a target="_blank" href="' + reportPath + '"><IMG SRC="' + pdfIcon + '"width=25% height=25%/></a>';
clearInterval(dots);
window.map.infoWindow.resize(256,256);
window.map.infoWindow.setContent(contentResult);
window.map.infoWindow.setTitle(displayCountry + " Forecast Analysis Report");
}
else{
window.gp_report.execute(taskParams,gpreportResultAvailable,gpreportFailure);
}
... View more
11-06-2017
07:23 AM
|
0
|
13
|
17787
|
POST
|
I've been dealing with this issue for a while. I have a geoprocessing tool on the ArcGIS server that generates a report from a map click. I get the CORS error when the server tries to return the report PDF to the popup in the map window. I've tried adding this to our webconfig file, and it doesn't help. <customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="*" />
<add name="Access-Control-Allow-Methods" value="*" />
</customHeaders> I tried adding this to my JavaScript code and it worked in once instance, but not another. esriConfig.defaults.io.corsEnabledServers.push("ourserver.com") I've also tried removing these lines from the webconfig and adding "Access-Control-Allow-Origin, * " under HTTP response headers in our IIS web server manager and I get this error "The 'Access-Control-Allow-Origin' header contains multiple values 'null, *', but only one is allowed. Origin 'null' is therefore not allowed access." I'm pulling my hair out trying figure this out.
... View more
11-02-2017
09:32 AM
|
2
|
22
|
50984
|
POST
|
I have a popup template that is set to show attachments from the feature layer. The popup displays the attachment as a hyperlink with the name of the source file on the ArcGIS Server, like: this_is_the_file.png. Is it possible to change this in the popup template to a generic text that points to the attachment, like I would with a URL hyperlink? var popupTemplate = new PopupTemplate({
title: "Forecast Analysis",
fieldInfos: [
{
fieldName: "Name",
visible: true,
label: "Location"
},
{
fieldName: "Lat",
visible: true,
label: "Latitude"
},
{
fieldName: "Lon",
visible: true,
label: "Longitude",
}
],
showAttachments: true
});
... View more
08-22-2017
09:39 AM
|
0
|
2
|
470
|
POST
|
Well, long story short we bought another domain name from Wix, and it messed up the SSL settings on our website. The HTML widgets that hold our map links were just empty, because they couldn't access our server. Word of warning to anybody that has a Wix site, they will not be able to help you with situations like this because they don't support "third party code." Ugh. Are those licenses extensions? I can't find those names anywhere. I guess it was an unrelated error, but it's still very strange.
... View more
08-18-2017
12:08 PM
|
1
|
1
|
650
|
POST
|
We realized our problem was actually with our web host. I'd still like to figure out what these errors mean.
... View more
08-17-2017
03:49 PM
|
0
|
4
|
650
|
POST
|
Our ArcGIS Server (10.3.1) just went down. I've restarted it several times, and tried reauthorizing the software to no avail. We keep getting these errors in the logs. I've never seen this before and I can't find any references on Google. Our entire website is down as a result of this.
... View more
08-17-2017
02:22 PM
|
0
|
5
|
1082
|
POST
|
I got around this by making a mobile friendly version of the map on our web host. We're going to start using App Studio soon to create mobile apps from our services.
... View more
08-16-2017
09:31 AM
|
1
|
0
|
290
|
POST
|
I have a webmap with time slider layers that looks terrible on a mobile phone. I've been trying to combine my existing map with elements from Mobile Tutorial and/or Simple Map for iOS. Is this possible? I noticed that these examples use JS 3.21compact, while my map just uses 3.21.
... View more
08-15-2017
01:55 PM
|
0
|
2
|
433
|
POST
|
Here's the whole script: <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>Neighborhood Pulse</title>
<link rel="stylesheet" href="https://js.arcgis.com/3.21/dijit/themes/claro/claro.css" />
<link rel="stylesheet" href="https://js.arcgis.com/3.21/esri/css/esri.css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open Sans">
<style>
html,
body {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
margin: 0;
font-family: "Open Sans";
}
#leftPane {
background-color: whitesmoke;
width: 20%;
border: solid 1px #000;
}
#photoPane {
background-color: whitesmoke;
width: 20%;
border: solid 1px #000;
//bottom: 700px;
height: 65%;
}
#map {
padding: 0;
border: solid 1px #000;
}
.nav {
padding: 5px 10px;
background: #4479BA;
color: #FFF;
border-radius: 5px;
border: solid 1px #20538D;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
}
#header {
text-align: center;
height: 8%;
border: solid 1px #000;
background-color: whitesmoke;
font-size: 19;
}
#HomeButton {
position: absolute;
top: 95px;
left: 245px;
z-index: 50;
}
#search {
display: block;
position: absolute;
z-index: 2;
top: 20px;
left: 290px;
}
.dijitDialogPaneContent {
width: 200px !important;
height: 100px !important;
}
</style>
<script src="https://js.arcgis.com/3.21/"></script>
<script>
var map, timer;
require([
"esri/lang",
"dojo/on",
"dojo/dom",
"dijit/registry",
"dojo/dom-construct",
"dojo/dom-style",
"dojo/parser",
"dijit/layout/BorderContainer",
"esri/layers/FeatureLayer",
"esri/dijit/PopupTemplate",
"esri/dijit/HomeButton",
"esri/dijit/Search",
"esri/dijit/BasemapGallery",
"esri/graphic",
"dijit/layout/ContentPane",
"esri/map",
"esri/arcgis/utils",
"esri/domUtils",
"dijit/TooltipDialog",
"esri/dijit/Popup",
"dijit/popup",
"dijit/Dialog",
"dojo/domReady!"
], function(
esriLang,
on,
dom,
registry,
domConstruct,
domStyle,
parser,
BorderContainer,
FeatureLayer,
PopupTemplate,
HomeButton,
Search,
BasemapGallery,
Graphic,
ContentPane,
Map,
arcgisUtils,
domUtils,
TooltipDialog,
Popup,
dijitPopup,
Dialog
) {
parser.parse();
map = new Map("map", {
showLabels: false,
basemap: "gray",
center: [-122.650, 45.52],
zoom: 11
});
var home = new HomeButton({
map: map
}, "HomeButton");
home.startup();
var search = new Search({
map: map,
showInfoWindowOnSelect: false,
enableLabel: false,
enableHighlight: false
}, "search");
search.startup();
var template = new PopupTemplate({
title: "{NAME}",
description: "<b>White Population</b>: {WhiteAlone_not_Hisp}" +
"<br><b>Total Population 2010</b>: {TotPOP_2010}" +
"<br><b>Neighborhood Coalition</b>: {LABEL_NAME_COALITION}"
});
var neighborhoodsLayer = new FeatureLayer(
"http://arcgis.research.pdx.edu/arcgis/rest/services/IMS_Services/Neighborhoods_Complete_nolabels/MapServer/29", {
infoTemplate: template,
outFields: ["*"],
maxScale: 0,
minScale: 0,
opacity: .60
});
map.addLayer(neighborhoodsLayer);
on(neighborhoodsLayer, "mouse-over", function(evt) {
clearTimeout(timer);
displayPopupContent(evt.graphic);
});
on(neighborhoodsLayer, "mouse-out", function(evt) {
timer = setTimeout(function() {
map.infoWindow.clearFeatures();
}, 100)
});
map.infoWindow.set("popupWindow", false);
initializeSidebar(map);
function initializeSidebar(map) {
var popup = map.infoWindow;
//when the selection changes update the side panel to display the popup info for the
//currently selected feature.
on(popup, "selection-change", function() {
displayPopupContent(popup.getSelectedFeature());
});
//When features are associated with the map's info window update the sidebar with the new content.
on(popup, "set-features", function() {
displayPopupContent(popup.getSelectedFeature());
});
}
function displayPopupContent(feature){
if (feature) {
var photoSRC = "https://images.trvl-media.com/media/content/shared/images/travelguides/destination/178299/Portland-20917.jpg";
var photo = '<a><IMG SRC="' + photoSRC + '"width=200 height=125/></a>';
var content = feature.getContent();
registry.byId("leftPane").set("content",content,photo);
registry.byId("photoPane").set("content",photo);
}
dialog = new TooltipDialog({
style: "position: absolute; width: 200px; font: normal normal normal 10pt Arial;z-index:100"
});
neighborhoodsLayer.on("click", function(evt){
var name = evt.graphic.attributes.NAME;
var nameNoDot = name.replace(/\./g,"");
var nameDash = nameNoDot.replace(/_/g, "-");
var nameLower = nameDash.toLowerCase();
var nboLink = "<b>${NAME}</b><hr><a id='myLink' target='_blank' href='http://neighborhoodpulsepdx.org/profiles/" + nameLower +
"'><b>Profile</b></a>";
var popupContent = esriLang.substitute(evt.graphic.attributes,nboLink);
dialog.setContent(popupContent);
//on(dom.byId("myLink"),"click", closeDialog);
domStyle.set(dialog.domNode, "opacity", 0.70);
dijitPopup.open({
popup: dialog,
x: evt.pageX,
y: evt.pageY,
});
function closeDialog(){
map.graphics.clear();
dijitPopup.close(dialog);
};
});
}
});
</script>
</head>
<body class="claro">
<div id="mainWindow" data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'headline',gutters:false" style="width:100%; height:100%;">
<div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="gutters:false" region="left" style="width:225px;height:100%;font-size:13;">
<div id="leftPane" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'"></div>
<div id="photoPane" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'bottom'"></div>
<div id="header" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'" style= "width:200px;height:10%;">
<div id="featureCount" style="margin-bottom:10px;"><b>Portland<br>Neighborhoods</b></div>
</div>
</div>
<div id="map" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'"></div>
<div id="search"></div>
<span id="info" style="font-family:arial;position:absolute;left:250px; bottom:5px; background-color:lightgray; opacity: 0.70; z-index:50;"></span>
<div id="HomeButton"></div>
<div style="position:absolute; left:250px; bottom:40px; z-Index:999;">
</div>
</body>
</html>
... View more
08-14-2017
07:26 AM
|
0
|
3
|
1059
|
POST
|
OK. I tired that and got this error: Cannot read property 'on' of null.
... View more
08-10-2017
02:35 PM
|
0
|
5
|
1059
|
Title | Kudos | Posted |
---|---|---|
1 | 04-08-2019 09:21 AM | |
1 | 04-05-2019 04:21 PM | |
2 | 04-01-2019 10:11 AM | |
1 | 08-18-2017 12:08 PM | |
1 | 01-07-2019 02:12 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|