Select to view content in your preferred language

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

6248
14
02-05-2015 09:06 AM
KeriLu
by
Deactivated User

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
KeriLu
by
Deactivated User

Hi Kelly,

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",

  "type": "MapServer"

  },

  {

  "name": "I3_Imagery_Prime_World",

  "type": "GlobeServer"

  },

  {

  "name": "NASA_CloudCover_World",

  "type": "GlobeServer"

  },

  {

  "name": "NatGeo_World_Map",

  "type": "MapServer"

  },

  {

  "name": "NGS_Topo_US_2D",

  "type": "MapServer"

  },

  {

  "name": "Ocean_Basemap",

  "type": "MapServer"

  },

  {

  "name": "USA_Topo_Maps",

  "type": "MapServer"

  },

  {

  "name": "World_Imagery",

  "type": "MapServer"

  },

  {

  "name": "World_Physical_Map",

  "type": "MapServer"

  },

  {

  "name": "World_Shaded_Relief",

  "type": "MapServer"

  },

  {

  "name": "World_Street_Map",

  "type": "MapServer"

  },

  {

  "name": "World_Terrain_Base",

  "type": "MapServer"

  },

  {

  "name": "World_Topo_Map",

  "type": "MapServer"

  }

]

}

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.

0 Kudos
KeriLu
by
Deactivated User

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.

0 Kudos
KeriLu
by
Deactivated User

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.

0 Kudos
KellyHutchins
Esri Notable Contributor

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.

0 Kudos
EngrUmair
Deactivated User

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?

0 Kudos