Hi guys,
I copied this exact map (Create a FeatureLayer with client side graphics - 4.0 ) to my website and while it works on my localhost machine, it fails on the web server. On the server, the map loads, but none of the earthquake data is showing. The error I see in console is:
Test.htm:337 Creating legend failed. SyntaxError: Unexpected token <
at Object.parse (native)
at c.json (https://js.arcgis.com/4.0/init.js:192:467)
at g (https://js.arcgis.com/4.0/init.js:191:119)
at k [as handleResponse] (https://js.arcgis.com/4.0/init.js:184:135)
at XMLHttpRequest.p (https://js.arcgis.com/4.0/init.js:188:240)errback @ Test.htm:337f @ init.js:150p @ init.js:149reject.errback @ init.js:151f @ init.js:150p @ init.js:149reject.errback @ init.js:151f @ init.js:150p @ init.js:149reject.errback @ init.js:151f @ init.js:150p @ init.js:149reject.errback @ init.js:151(anonymous function) @ init.js:327e @ init.js:153f @ init.js:153l.reject @ init.js:156c @ init.js:154e @ init.js:154f @ init.js:153l.reject @ init.js:156c @ init.js:154e @ init.js:154f @ init.js:153l.reject @ init.js:156c @ init.js:154e @ init.js:154f @ init.js:153l.reject @ init.js:156c @ init.js:154e @ init.js:154f @ init.js:153l.reject @ init.js:156k @ init.js:184p @ init.js:188
I don't have any clue on how to debug this. Any help is appreciated, thanks.
I'm also attaching a screenshot of the "suspected" area when I click on the last line of the error console.
Edit: This example is run on a asp.net environment. I put the same test map on a PHP server and it works. Does this have something to do with file permissions?