Hmmm....not sure what's going on here. I used to be able to grab my csv file from our server and do and xy events so the point shows up on the webmap made with the Javascript Api but I can't seem to do that anymore. I have been reading the discussion forums and a few suggestions mention setting up a proxy server. I ran the .jsp file but I am not really sure how to proceed? Doen't seem to make a difference. My csv file simply doesn's show up as points on my map anymore. I do not clearly understand the process of registering an app on the ArcGIS for Developers site either? Can someone please help me clarify?
Thanks!!
Hi Kelly,
Mine app is working fine with csv at usgs, I have downloaded csv and added at local iis now how could I request local csv file rather to request at usgs. which code should I change?
If the Csv is on the same domain as your app you won't need the proxy. In the example code the csv is coming from the Usgs site so you'd need a proxy. If you download that csv and add it to your web server then your code should run without needing a proxy.
What I find interesting about everything is that my points worked just fine in November when I ran the same code. It didn't need a proxy server setup or anything. I could put a csv on oput GIS site and it would populate the map with points. No problem. I tried uninstalling and reinstalling Google Chrome to no avail.
My errors in the console has changed to:
XMLHttpRequest cannot load file:///C:/proxy/?http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.csv. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
js.arcgis.com/3.11/init.js:192 q
js.arcgis.com/3.11/esri/layers/CSVLayer.js:19 error: RequestError: Unable to load /proxy/?http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.csv status: 0
js.arcgis.com/3.11/init.js:164 The XMLHttpRequest progress event property 'position' is deprecated. Please use 'loaded' instead.
I followed the instructions and set up the proxy site I keep getting the following error when I ping
{"error": {"code": 403,"details": ["The proxy tried to resolve a prohibited or malformed URL. The server does not meet one of the preconditions that the requester put on the request."], "message": "403 - Forbidden: Access is denied."}}
The Esri rest services link looks like this whenever I run the Tomcat startup.bat file.
{
"currentVersion": 10.2,
"folders": [
"Canvas",
"Demographics",
"Elevation",
"Ocean",
"Reference",
"Specialty",
"Utilities"
],
"services": [
"name": "ESRI_Imagery_World_2D",
"type": "MapServer"
},
"name": "ESRI_StreetMap_World_2D",
"name": "I3_Imagery_Prime_World",
"type": "GlobeServer"
"name": "NASA_CloudCover_World",
"name": "NatGeo_World_Map",
"name": "NGS_Topo_US_2D",
"name": "Ocean_Basemap",
"name": "USA_Topo_Maps",
"name": "World_Imagery",
"name": "World_Physical_Map",
"name": "World_Shaded_Relief",
"name": "World_Street_Map",
"name": "World_Terrain_Base",
"name": "World_Topo_Map",
}
]
Not sure what I am missing here but the points still do not show up on my map when not the code is not ran in the sandbox.
Keri,
It looks like you are running the code from file:// instead of from a web server. You'll want to setup a web server and test the samples there. More info on how to do this can be found here:
Set up a development environment | API Reference | ArcGIS API for JavaScript
Here is info on how to open the developer tools for Chrome. Once you have them open click on console then re-run your app and see if any error messages appear.
https://developer.chrome.com/devtools
Do you have a proxy setup locally? Because the csv data used in the sample is not on the same domain as your web site you'll need to setup a proxy. Details on setting up a proxy can be found here:
Esri/resource-proxy · GitHub
If you want to test to see if this is a proxy issue you can download a copy of the csv and host it on your web server. http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.csv
Ok. Thanks.
XMLHttpRequest cannot load file:///C:/proxy/?http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.csv. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.init.js:162 k
init.js:192 q
CSVLayer.js:19 error: RequestError: Unable to load /proxy/?http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.csv status: 0CSVLayer.js:19 f.error
init.js:164 The XMLHttpRequest progress event property 'position' is deprecated. Please use 'loaded' instead.
Those are the error messages I am getting.
The code only works in the sandbox environment.
Keri which browser are you using for testing?
I do not know how to check the browser's developer console. I used to be able to run this simple code CSV | ArcGIS API for JavaScript but I can't even do that anymore.
When you run your app have you checked the browsers developer console to see if there are any error messages?
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.