Book Image

ArcGIS for JavaScript Developers by Example

By : Jayakrishnan Vijayaraghavan, Yogesh Dhanapal
Book Image

ArcGIS for JavaScript Developers by Example

By: Jayakrishnan Vijayaraghavan, Yogesh Dhanapal

Overview of this book

<p>The book starts by explaining the basics of the ArcGIS web mapping ecosystem. The book walks you through the development of six major applications, covering a wide variety of topics such as querying, rendering, advanced data visualization and performing map analytics. It also emphasizes on writing modular code using pure dojo, which is the preferred platform for developing web GIS applications using ArcGIS JavaScript API.</p> <p>By the end of the book, you will have gained enough practical experience to architect a robust and visually powerful mapping application using the API.</p>
Table of Contents (16 chapters)
ArcGIS for JavaScript Developers by Example
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface
Index

Preface

Web technologies are changing rapidly and so is the ArcGIS JavaScript API. Regardless of your development experience, ArcGIS offers an easy way to create and manage geospatial applications. It gives you access to mapping and visualization, analysis, 3D, data management, and support for real time data.

What this book covers

Chapter 1, Foundation for the API, endeavors to lay a firm foundation for the topics dealt with throughout the book. The basic environment needed to follow the explained topics further as well as to develop professional-looking code is set in this chapter. An introduction to dojo and the modular pattern of JavaScript coding is provided along with an explanation of basic ArcGIS concepts. Users are shown brief explanations with code snippets or diagrams about basic concepts wherever needed.

Chapter 2, Layers and Widgets, deals with the different types of layers used in the API along with the ideal context where each type is used. We will also be introduced to some of the most commonly used in-built widgets provided by Esri to use in our application.

Chapter 3, Writing Queries, will have an in-depth look into writing different types of queries, retrieving the results and displaying it. We will be developing a Wildfire app to understand how the types of query operations such as Identify, Find and Query task. We will also learn how to display a tabular information using a FeatureTable widget and format popup content using Infotemplates.

Chapter 4, Building Custom Widgets, will explain how to organize all the code into modularized widgets, and use it in our application. We will discuss how to configure dojo globally and how to provide support for internationalization. We will be extending the Wildfire app we developed in the previous chapter by constructing a spatial query that involves using the Draw toolbar.

Chapter 5, Working with Renderers, gives an in-depth treatment on the topic of colors, symbols, renderers, and the situations where each can be used effectively. This chapter will also deal with the nuances of data visualization techniques along with tips and tricks to create symbols and picture marker symbols easily. We will demonstrate the utility of three basic renderers: simple renderer, unique value renderer, and class breaks renderer by developing a Stream Gauge app.

Chapter 6, Working with Real-Time Data, will cover in detail what constitutes the real-time data, and it will also cover how to visualize data and get the most recently updated data. We will be building a hurricane tracking app to demonstrate this and will be adding a Global wind data gauge and a weather widget using geometry engine capability provided by the API and the geolocation feature provided by modern browsers.

Chapter 7, Map Analytics and Visualization Techniques, will take you a step closer toward becoming a map data scientist. We will cover a lot of ground in this chapter starting with a brush up of a few introductory statistics concepts. We will see the code in action and understand how statistics definition and feature layer statistics module can give us invaluable statistic measures, which can be used to render the map data meaningfully. We will then evaluate how to use the visual variables, such as colorInfo, opacityInfo, rotationInfo, and sizeInfo effectively in a renderer. We will use the knowledge gained to start building a demographics analytic portal.

Chapter 8, Advanced Map Visualization and Charting Libraries, will be using three different charting libraries such as dojo, D3.js and Cedar to extend the Demographics portal we started building in the previous chapter and more provide visual-analytical information to the users.

Chapter 9, Visualization with Time Aware Layers, will explain how to visualize spatiotemporal data using TimeSlider dijit, a custom D3.js timeslider as well a custom Time series Histogram by incorporating these on a Time-aware US Drought data.

What you need for this book

For this book, we'll need NotePad++/Brackets Editor, Google Chrome/Mozilla Firefox or any modern browser, Visual Studio Community Edition 2015, and Node.js for Windows.

Who this book is for

This book is for JavaScript developers who wish to develop amazing mapping applications using the rich set of features provided by the ArcGIS JavaScript API, but more than this, a spatial frame of mind will help the user go a long way.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "After installing IIS, you can find the executables in the IIS Express folder inside the Program Files folder "

A block of code is set as follows:

<link rel="stylesheet" href="http://js.arcgis.com/3.15/esri/css/esri.css">

<script src="http://js.arcgis.com/3.15/"></script>

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

on(map, "layers-add-result", function (evt) {
console.log("1.", earthQuakeLayer.id);
...
console.log("5.", worldCities.layerInfos);
});

Any command-line input or output is written as follows:

1. Earthquake Layer
2. [Object,
Object,
. . .
Object]
 3. esriGeometryPoint
4. 1000
5. [Object, Object, Object]

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Click on the Add button against the IIS Express application name, and then click on the Install button."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

You can download the code files by following these steps:

  1. Log in or register to our website using your e-mail address and password.

  2. Hover the mouse pointer on the SUPPORT tab at the top.

  3. Click on Code Downloads & Errata.

  4. Enter the name of the book in the Search box.

  5. Select the book for which you're looking to download the code files.

  6. Choose from the drop-down menu where you purchased this book from.

  7. Click on Code Download.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows

  • Zipeg / iZip / UnRarX for Mac

  • 7-Zip / PeaZip for Linux

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from http://www.packtpub.com/sites/default/files/downloads/ArcGISForJavaScriptDevelopersByExample_ColorImages.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.