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.

dchillman (3) [Avatar] Offline
basically the same comment as the chapter 2 code - there seems to be a disconnect in the code samples and the code in the chapter. as a beginner, I find the code samples quite valuable in following the chapter text, and when the two don't agree, confusion sets in, especially when you start discussing the proxy page, especially when just using it to get around the 2048 character limit - it would be very useful to see all of the setting for a working proxy page. thanks
rene.rubalcava (10) [Avatar] Offline
Re: chapter 3 code
There has been some rework in the source code samples and how the code is referenced in the chapters. If it's not in sync at the moment, it should be in the next MEAP release and definitely by finished release. Sorry about that.
342824 (2) [Avatar] Offline
I too was a bit confused in chapter 3.2 with trying to read through the legendtoc code. I am a beginner at JS, and coupled with the complexity of having to learn both the arcgis js API and dojo, I am at a loss. The book/code seems to skip from fairly easy to work with code, to something that is fairly overwhelming. With the newer book release, will we have access to the revised chapter? Any tips on learning the dojo fundamentals?
Rene Rubalcava (12) [Avatar] Offline
Sorry about that. My intent in that example wasn't so much to focus on the code, but to highlight how you can use the ArcGIS REST API to do stuff outside the confines of the ArcGIS JavaScript API. The steps to do so are complicated which is why I tried to show only the important parts.

I have simplified the steps to build a legend/ToC widget in this blog post on the Esri forums.

Let me know if there is anything else I can do to help.

342824 (2) [Avatar] Offline
I may have also spoken too soon. I did a bit of backtracking and revisited some basic JS programming stuff, then read in depth about Dojo. After that, it was easy to get what I needed from your text.

364454 (1) [Avatar] Offline
I think there is an issue with Listing 3.1 on the buffer distance.
It looks like the sample code uses the default Web Mercator to generate the buffer, but I believe measurements are not accurate in Web Mercator.
I edited the code like this.
// added line below to use state plane projection to get accurate distance buffer.
params.bufferSpatialReference = new SpatialReference({ wkid: 2227 });
// params.outSpatialReference = map.spatialReference;

Check the original code and this code and you see a big difference.