CSV File will not display points anymore in the JavaScript api?

5412
14
02-05-2015 09:06 AM
KeriLu
by
New Contributor

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!!

0 Kudos
14 Replies
KellyHutchins
Esri Frequent Contributor

When you run your app have you checked the browsers developer console to see if there are any error messages?

0 Kudos
KeriLu
by
New Contributor

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.

0 Kudos
KellyHutchins
Esri Frequent Contributor

Keri which browser are you using for testing?

0 Kudos
KeriLu
by
New Contributor

The code only works in the sandbox environment.

0 Kudos
KeriLu
by
New Contributor

0 Kudos
KellyHutchins
Esri Frequent Contributor

Keri,

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 

0 Kudos
KeriLu
by
New Contributor

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.

0 Kudos
KellyHutchins
Esri Frequent Contributor

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

0 Kudos
KellyHutchins
Esri Frequent Contributor

Keri,

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 

0 Kudos