The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

dmdiggs (3) [Avatar] Offline
#1
We (myself and my students) are stuck at the end of Chapter 5 Part 1 page 112. We can't get the Requests button to pop-up with the Requests dialog box. We are using your code (chapter5/part1/app). We are all running this from machines that have been configured with IIS/Windows 8.1. Each student has their own machine/web server. When we click on the requests button (upper right) it becomes highlighted. Then when we click on the map--we get a quick zoom in, and that's all. Chapter 5 parts 2 and 3 work as advertised. So I know we've all set up our arcgis.com feature services correctly. I know that in some ways--this doesn't matter--as we go onto change the code in Parts 2 and 3. However we are curious as to why this is failing. Any ideas?
Rene Rubalcava (12) [Avatar] Offline
#2
That is odd. I looked over the code in the book and the code I'm using and I'm not noticing any obvious differences. Can you try part 1 from the github repo to see if that works?
https://github.com/odoe/ArcGISWebDev/tree/master/chapter5/part1/app

I'll keep digging around to see if I can find anything missing from the code sample in the book.

Thanks!
347873 (1) [Avatar] Offline
#3
ERROR : Unable to Configure a proxy
WebSite6.rar
[ 11 KB ]
Please help me in this regard.

XMLHttpRequest cannot load http://nit445/WebSite6/proxy.ashx?http://nit445/ArcGIS/rest/services/bmptlinJS/FeatureServer/0/applyEdits. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
Rene Rubalcava (12) [Avatar] Offline
#4
ERROR : Unable to Configure a proxy
347873 wrote:Please help me in this regard.

XMLHttpRequest cannot load http://nit445/WebSite6/proxy.ashx?http://nit445/ArcGIS/rest/services/bmptlinJS/FeatureServer/0/applyEdits. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.


Is this effecting the use of your application or does the error show in your debug tools and the application still works?
You will probably still receive this error when developing your application, but it should not impact the performance of your application. This is a CORS issue and is usually just an error from the API, but it has built in workarounds for it.
JMing (4) [Avatar] Offline
#5
Rene Rubalcava wrote:That is odd. I looked over the code in the book and the code I'm using and I'm not noticing any obvious differences. Can you try part 1 from the github repo to see if that works?
https://github.com/odoe/ArcGISWebDev/tree/master/chapter5/part1/app

I'll keep digging around to see if I can find anything missing from the code sample in the book.

Thanks!



Hi Rene,
I downloaded your code from github, and put it on my own website. But when I login with my ArcGIS Online account, I can see no icon. I check the console, and found this error:
Error: You do not have permissions to access this resource or perform this operation. "Error: You do not have permissions to access this resource or perform this operation.

When I try to build this project (chapter5, part 1) by following the book, I met the same situation like the one dmdiggs met. The icon shows, but no responds after clicking.

A little advise, can you publish your samples to some kinds of server, so that everybody who bought your book can have a look at what the really working code and website looks like. At that time, nobody will doubt whether there is something wrong with your code. And focus on looking into setting issue.

Thanks for this good book anyway.
JMing (4) [Avatar] Offline
#6
JMing wrote:
Rene Rubalcava wrote:That is odd. I looked over the code in the book and the code I'm using and I'm not noticing any obvious differences. Can you try part 1 from the github repo to see if that works?
https://github.com/odoe/ArcGISWebDev/tree/master/chapter5/part1/app

I'll keep digging around to see if I can find anything missing from the code sample in the book.

Thanks!



Hi Rene,
I downloaded your code from github, and put it on my own website. But when I login with my ArcGIS Online account, I can see no icon. I check the console, and found this error:
Error: You do not have permissions to access this resource or perform this operation. "Error: You do not have permissions to access this resource or perform this operation.

When I try to build this project (chapter5, part 1) by following the book, I met the same situation like the one dmdiggs met. The icon shows, but no responds after clicking.

A little advise, can you publish your samples to some kinds of server, so that everybody who bought your book can have a look at what the really working code and website looks like. At that time, nobody will doubt whether there is something wrong with your code. And focus on looking into setting issue.

Thanks for this good book anyway.


OK, I found the trick to solve the problem now...
1. down load the github zip file from the link provided by author.
2.Chapter 5 part 1 should work after two simple changes.
1)/js/services/mapservices.js:
change REQUEST_URL = "......". Put your own service URL here, because you have no permission to author's map service.
2)/js/controllers/appcontroller.js:
You can find some "interesting" comments here. When you uncomment
Line 48 //editorWidget.startup();
and Line 53 //esriConfig.defaults.io.proxy = '/proxy/proxy/php';
Bang! It works!

Rene Rubalcava (12) [Avatar] Offline
#7
I have put up a page that shows all the samples from the book, thanks for the suggestion!
http://odoe.net/arcgiswebdev/

I hope that helps!