I want to programmatically add a csv layer to a web appbuilder app hosted on a web server. Any suggestions? I have seen some threads about revising the mapmanager.js file and using map.addLayer.
Solved! Go to Solution.
Brandon,
Hmm.. So your issue is that when you add a CSV from a url that is on a different server and then deploy the app you run into a cross domain issue and you need to use a proxy in your deployed app. Once I added http://www.dot.ca.gov to my proxy.config used in my hosted WAB app then the csv layer showed up fine.
Hi Brandon,
Any reason not to sue the Add Data widget?
Hello Jake:
The add data widget would only temporarily add the data to the app for only a single session correct? I would like to permanently add the csv later so that every user can already access the csv layer when they access the app. The ArcGIS online version of the app has the csv layers visible. The hosted version of the same app never loads the csv layer. That's why I wanted to see if it could manually re-added.
Brandon,
That is strange. I did a test and created a web map using some csv data and then added that web map to a WAB dev app and then downloaded the app and hosted locally on my web server and never has an issue with the CSV layer being accessible.
This is one of the url's that only shows in the arcgis online wab and not the downloaded version:
http://www.dot.ca.gov/cwwp2/data/d7/cctv/cctvStatusD07.csv
I was trying to follow this to programmatically add the csv file:
https://community.esri.com/message/748814-add-and-remove-fetaure-layer-to-wab
Brandon,
Hmm.. So your issue is that when you add a CSV from a url that is on a different server and then deploy the app you run into a cross domain issue and you need to use a proxy in your deployed app. Once I added http://www.dot.ca.gov to my proxy.config used in my hosted WAB app then the csv layer showed up fine.
Thanks Robert. I guess I will reference https://community.esri.com/groups/technical-support/blog/2015/04/07/setting-up-a-proxy to set a proxy on the hosted server
Yes.
I got this to show:
Thanks Robert.