O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

ArcGIS for JavaScript Developers by Example

Book Description

A practical guide to get you creating powerful mapping applications using the rich set of features provided by the ArcGIS JavaScript API

About This Book

  • Unshackle your GIS application from a workstation! Get running with three major web mapping projects covering all the important aspects of the ArcGIS JavaScript API.
  • Set a strong foundation for the ArcGIS JavaScript API and modular coding with dojo.
  • Gain a crystal clear understanding of the ArcGIS JavaScript, and become skilled in creating exciting and interesting geospatial apps.

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 that, a spatial frame of mind will help a long way.

What You Will Learn

  • Find out what you need to develop a web mapping application in the ArcGIS environment
  • Get to know about the major features provided by the ArcGIS JavaScript API
  • See the coding best practices to develop modular dojo-based JavaScript applications
  • Get to grips with writing custom re-usable dojo modules using dojo and esri modules and dijits
  • Understand how to use various ArcGIS data sources and other open geospatial data available on the web
  • Discover how to query spatial data and get the best out of your data using analytical techniques
  • Master the art of rendering your map beautifully and create wonderful data visualizations using non-map objects such as charts
  • Grasp how to create secure and scalable web maps

In Detail

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.

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.

Style and approach

This is a practical, hands-on guide on using the ArcGIS JavaScript API to develop mapping applications. It is packed with three progressively challenging and diverse projects that explain the plethora of API and dojo topics.

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased 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 code file.

Table of Contents

  1. ArcGIS for JavaScript Developers by Example
    1. Table of Contents
    2. ArcGIS for JavaScript Developers by Example
    3. Credits
    4. About the Authors
    5. About the Reviewer
    6. www.PacktPub.com
      1. eBooks, discount offers, and more
        1. Why subscribe?
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Downloading the color images of this book
        3. Errata
        4. Piracy
        5. Questions
    8. 1. Foundation for the API
      1. Setting up the development environment
        1. Browser, web server, and IDE
          1. Web browser
          2. Web server
          3. IDE
        2. Setting up an ArcGIS Developer account
        3. Hello, Map – the jump-start code
        4. Understanding the jump-start code
          1. The API reference link
          2. The AMD pattern of coding
          3. The esri/map module
      2. Setting the initial map extent
        1. Brushing up some coordinate geometry
          1. Quiz time!
          2. Spatial reference systems
          3. The quiz results
          4. Getting the current map extent
          5. The template generator for loading modules
      3. Understanding dojo and AMD
        1. The key components of AMD
          1. The define method
          2. The require method
        2. Some awesome dojo modules
          1. Dojo dom modules
          2. Dojo event handler module
          3. Dojo array module
            1. dojo/_base/array
      4. Understanding ArcGIS Server and the REST API
        1. Types of service
        2. Working with the Service Catalog
          1. Map server
            1. The Query endpoint
      5. Summary
    9. 2. Layers and Widgets
      1. Data sources supported by the API
        1. Flat file formats
          1. KML
          2. CSV files
        2. ArcGIS Server
      2. The concept of layers
        1. Adding layers to a map
        2. The functional classification of layers
          1. Basemap layers
          2. Functional layers
          3. Graphics layers
        3. Types of layers
          1. The ArcGIS Tiledmap service layer
          2. Spatial Reference
            1. TileInfo
            2. Extent and Scale Info
          3. The ArcGIS DynamicMapService layer
          4. Feature layers
            1. The FeatureLayer constructor
            2. Infotemplates
          5. Graphics layer
            1. Geometry
            2. Symbol
            3. Attributes
            4. InfoTemplate
        4. Map and layer properties
        5. Map and layer events
      3. Using Esri widgets – the genie's lamp
        1. The BaseMapGallery widget
        2. The Legend widget
      4. Summary
    10. 3. Writing Queries
      1. Developing the Wildfire application
        1. Registering the application in the developer portal
        2. Using a proxy in the application
        3. Bootstrapping the application
      2. Types of querying operations
        1. Query task
        2. Find task
        3. Identify task
      3. Building and executing a Query task
        1. The QueryTask constructor
          1. Constructor parameters
        2. Instantiating the QueryTask object
        3. Building the Query object
          1. Querying by spatial geometry
        4. Executing the query
          1. Querying for Count
          2. Query for Features
          3. Query for Extent
      4. Building and executing IdentifyTask
        1. Instantiating IdentifyTask
        2. Constructing the identify parameters object
        3. Executing IdentifyTask
      5. Building and executing a Find task
        1. Instantiating a Find task
        2. Building the Find parameters
        3. Executing a Find task
      6. Building a feature table
      7. Building popups
        1. Building InfoTemplates
      8. Summary
    11. 4. Building Custom Widgets
      1. Creating a simple class
        1. Configuring dojo
      2. Developing a standalone widget
        1. The dijit life cycle
        2. Creating templated widgets
      3. Widget folder structure
        1. Guidelines for creating project folders
          1. Creating a single point of entry
          2. Defining dojoConfig
          3. Modularizing the code
          4. Providing support for internationalization
            1. Steps to provide internationalization support
          5. An overview of the widget folder structure
      4. Building a custom widget
        1. Modules required for the widget
          1. Modules for the class declaration and OOPS
          2. Modules for using HTML templates
          3. Module for using event
          4. Modules for manipulating dom elements and their styles
          5. Modules for using the draw toolbar and displaying graphics
          6. Modules for querying data
          7. Modules for internationalization support
        2. Using the draw toolbar
          1. Initiating the draw toolbar
          2. The draw operation
          3. The draw-end event handler
          4. Symbolizing the drawn shape
        3. Executing the query
          1. Initializing the QueryTask and Query object
          2. Query event handlers
            1. Defining the HTML template
            2. Symbolizing query results
            3. Adding the graphics to the map
      5. Summary
    12. 5. Working with Renderers
      1. Working with colors
        1. The RGB color model
        2. The Esri color module
      2. Working with symbols
        1. SimpleLineSymbol
        2. SimpleMarkerSymbol
        3. ArcGIS symbol playground
        4. SimpleFillSymbol
        5. PictureMarkerSymbol
          1. PictureFillSymbol
          2. TextSymbol
      3. Working with renderers
        1. Choosing a renderer for a scenario
        2. Developing a Stream Gauge application
          1. The data source
        3. Simple renderer
        4. Applying unique value renderer
        5. Class breaks renderer
        6. HeatmapRenderer
        7. DotDensityRenderer
        8. BlendRenderer
        9. SmartMapping
        10. A classification method for classed renderers
      4. Summary
    13. 6. Working with Real-Time Data
      1. Background about the application
      2. Visualizing map data
      3. Building a hurricane tracking app
        1. Symbolizing active hurricane layers
      4. Adding a global wind data gauge
      5. Tracking the latest active hurricanes
        1. Getting a unique list of storms
        2. Fetching the latest data and displaying on the grid
          1. Refreshing feature layer
      6. Creating a weather widget
        1. The open weather API
        2. Using the Geolocation API
          1. Using geometry engine on input data
        3. Displaying the weather data in the widget
      7. Summary
    14. 7. Map Analytics and Visualization Techniques
      1. Building a demographics analytic portal
      2. Basic statistical measures
        1. Minimum
        2. Maximum
        3. Sum
        4. Average
        5. Standard deviation
        6. Standardization
      3. Statistical functionality provided by the API
        1. StatisticDefinition module
        2. Classification methods
          1. Equal interval
          2. Natural breaks
          3. Quantile
          4. Standard deviation
        3. Concept of normalization
        4. Feature layer statistics
      4. Working with continuous and break renderers
        1. ColorInfo
          1. Selecting a color scheme
          2. Creating a classed color renderer
        2. opacityInfo
          1. Using opacityInfo to create a classes opacity renderer
        3. SizeInfo
        4. RotationInfo
        5. Multivariate mapping
      5. Smart mapping
      6. Summary
    15. 8. Advanced Map Visualization and Charting Libraries
      1. Charting with dojo
        1. Dojo chart themes
        2. Charting using the popup template
      2. Types of 2D charts provided by dojox modules
        1. Dojo charting methods
          1. Defining your plot
          2. Defining the theme
          3. Pushing the data
          4. Chart plugins
      3. Charting with D3.js
        1. Creating a column chart with D3
          1. D3 selections
          2. D3 data
          3. D3 scaling
          4. Integrating SVG into D3 charts
      4. Charting with Cedar
        1. Loading Cedar libraries
          1. Loading using the script tags
          2. Loading using the AMD pattern
      5. Summary
    16. 9. Visualization with Time Aware Layers
      1. Time aware layers
        1. Need for time aware layers
        2. Understanding time aware layers
      2. Building the Drought app
        1. Using the Time Slider
          1. Steps to create a TimeSlider
      3. Querying based on time using D3
        1. Scaling and formatting time
        2. D3 brush
      4. Advanced spatio-temporal visualization with Cedar
      5. Summary
    17. Index