Book Image

Mastering ArcGIS Server Development with JavaScript

By : Raymond Kenneth Doman
Book Image

Mastering ArcGIS Server Development with JavaScript

By: Raymond Kenneth Doman

Overview of this book

Table of Contents (18 chapters)
Mastering ArcGIS Server Development with JavaScript
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

In this digital age, we expect maps to be available wherever we are. We search for driving directions on our phone. We look for business locations and nearby restaurants using apps. Maintenance personnel use digital maps to locate assets several feet underground. Government officials and C-level executives need up-to-date location data to make important decisions that affect many lives.

ESRI has been an industry leader for 30 years in the realm of digital mapping. Through products such as ArcGIS Server, they empower companies, government agencies, and digital cartographers to publish maps and geographic data on the Web. Websites and applications written with the ArcGIS API for JavaScript make those maps available on both desktop and mobile browsers. The API also provides the building blocks needed to create powerful applications for data presentation, collection, and analysis.

While there are plenty of examples, blog posts, and books to get you started in developing apps with the ArcGIS API for JavaScript, they don't often go that deep. They don't discuss the pitfalls, limitations, and best practices for developing applications with their tools. That next step is what this book tries to accomplish.

What this book covers

Chapter 1, Your First Mapping Application, introduces you to ArcGIS Server and the ArcGIS API for JavaScript. In this chapter, you will learn the basics of creating a map and adding layers.

Chapter 2, Digging into the API, gives an overview of the many API components, widgets, and features that are available within the ArcGIS API for JavaScript. This chapter offers explanations of how these components can be used.

Chapter 3, The Dojo Widget System, explores the Dojo framework, the comprehensive JavaScript framework the ArcGIS API for JavaScript is built in. This chapter explores the inner workings of Asynchronous Module Design (AMD) and how to build custom widgets for our mapping applications.

Chapter 4, Finding Peace in REST, examines the ArcGIS REST API, which defines how ArcGIS Server communicates with the application in the browser.

Chapter 5, Editing Map Data, covers how to edit geographic data stored in ArcGIS Server. This chapter examines the modules, widgets, and user controls provided by the ArcGIS JavaScript API.

Chapter 6, Charting Your Progress, looks at how you can convey map feature information through charts and graphs. The chapter not only discusses charts and graphs made with the Dojo Framework, but also looks at how to integrate other charting libraries, such as D3.js and HighCharts.js.

Chapter 7, Plays Well with Others, discusses ways to integrate other popular libraries into an application written with the ArcGIS API for JavaScript. This chapter also explores combining the framework with jQuery, Backbone.js, Angular.js, and Knockout.js.

Chapter 8, Styling Your Map, covers the use of CSS styling in the mapping application. This chapter examines how the Dojo framework lays out elements, and explores adding the Bootstrap framework to style the mapping application.

Chapter 9, Mobile Development, looks at the need to develop with mobile in mind and discusses the pitfalls of attempting to make your app "mobile-friendly". This chapter implements the dojox/mobile framework, provided by the Dojo framework, as a way to style elements for mobile use.

Chapter 10, Testing, discusses the need for test-driven and behavior-driven development. This chapter discusses how to test applications using the Intern and Jasmine testing frameworks.

Chapter 11, The Future of ArcGIS Development, looks at new mapping and application services such as ArcGIS Online and Web AppBuilder. You will learn how to develop an application around an ArcGIS Online webmap.

What you need for this book

For all the chapters in the book, you will need a modern browser and a text editor to create files. Whichever text editor you choose is up to you, though one with syntax highlighting and some sort of JavaScript lining would help. For exercises in Chapter 5, Editing Map Data and Chapter 9, Mobile Development, you will also need access to a web hosting server to test files written in Java, PHP, or .NET. Finally, for the exercise in Chapter 10, Testing, you will need an up-to-date version of Node.js installed locally on your machine.

Who this book is for

This book is for web developers with some experience with ArcGIS Server, or geospatial professionals with some experience writing HTML, JavaScript, and CSS. This book assumes that you have viewed some of the ArcGIS API for JavaScript examples provided by ESRI. More importantly, this book is for someone who wishes to dive deeper into application development using ArcGIS Server. Other books provided by Packt Publishing, such as Building Web and Mobile ArcGIS Server Applications with JavaScript by Eric Pimpler or Building Web Applications with ArcGIS by Hussein Nasser, may be more suitable for an introduction to ArcGIS Server and the ArcGIS API for JavaScript.

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: "We're working with census data, let's call it census.html."

A block of code is set as follows:

<!DOCTYPE html>
<html>
<head></head>
<body></body>
</html>

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

<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
  <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
  <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
  <title>Census Map</title>
  <link rel="stylesheet" href="http://js.arcgis.com/3.13/esri/css/esri.css" />
  <style>
    html, body {
      border: 0;
      margin: 0;
      padding: 0;
      height: 100%;
      width: 100%;
    }
  </style>
  <script type="text/javascript">
    dojoConfig = {parseOnLoad: true, debug: true};
  </script>
  <script type="text/javascript" src="http://js.arcgis.com/3.13/" ></script>
</head>

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: "We positioned it precisely in the top right, and left a little gap for the Census button to be centered vertically."

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 from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. 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.

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/6459OT_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.