Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Building Web and Mobile ArcGIS Server Applications with JavaScript ??? Second Edition
Building Web and Mobile ArcGIS Server Applications with JavaScript ??? Second Edition

Building Web and Mobile ArcGIS Server Applications with JavaScript ??? Second Edition: Build exciting custom web and mobile GIS applications with the ArcGIS Server API for JavaScript , Second Edition

Arrow left icon
Profile Icon Mark Lewin Profile Icon Eric Pimpler
Arrow right icon
AU$14.99 AU$60.99
eBook Oct 2017 324 pages 2nd Edition
eBook
AU$14.99 AU$60.99
Paperback
AU$75.99
Subscription
Free Trial
Renews at AU$24.99p/m
Arrow left icon
Profile Icon Mark Lewin Profile Icon Eric Pimpler
Arrow right icon
AU$14.99 AU$60.99
eBook Oct 2017 324 pages 2nd Edition
eBook
AU$14.99 AU$60.99
Paperback
AU$75.99
Subscription
Free Trial
Renews at AU$24.99p/m
eBook
AU$14.99 AU$60.99
Paperback
AU$75.99
Subscription
Free Trial
Renews at AU$24.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Building Web and Mobile ArcGIS Server Applications with JavaScript ??? Second Edition

Creating Maps and Adding Layers

We all have to start somewhere when learning a new programming language or Application Programming Interface (API). The same applies to creating web mapping applications with the ArcGIS API for JavaScript. Not only do you need to understand some basic JavaScript concepts but you also need to have a grasp of HTML, CSS, and of course the ArcGIS API for JavaScript, which is actually built on top of the Dojo JavaScript framework. That's a lot to put on your plate at once, so in this chapter we'll have you create a very basic application that will serve as a foundation which you can build on in the coming chapters.

Mimicry is an excellent way to learn programming skills, so in this chapter I'm just going to have you type in the code that you see and we'll provide some explanation along the way. We'll save the detailed descriptions...

The ArcGIS API for JavaScript Sandbox

In this book you're going to use the ArcGIS API for JavaScript Sandbox to write and test your code. The Sandbox can be found at https://developers.arcgis.com/javascript/3/sandbox/sandbox.html and will appear as seen in the screenshot when loaded. You'll write your code in the left pane and click the REFRESH button to see the results in the right pane:

Basic steps for creating an application with the ArcGIS API for JavaScript

Now that we've got some of the basics of HTML, CSS, and JavaScript out of the way it's time to actually get to work and learn how to build some great GIS web applications! The material in this chapter will introduce you to some of the fundamental concepts that define how you create a map and add information to the map in the form of layers.

There are several steps that you'll need to follow for creating any GIS web application with the ArcGIS API for JavaScript. These steps will always need to be performed if you intend to have a map as part of your application. And I can't imagine that you wouldn't want to do that, given that you're reading this book! In a nutshell,there are several steps you need to follow:

  • Create the HTML code for the page
  • Reference the ArcGIS API for JavaScript...

More about the map

You'll need to follow the preceding process we described for every application that you build with the ArcGIS API for JavaScript.

The creation of the map can only happen when your HTML has finished loading, and all the required DOM elements and scripts are ready. You achieved this by using the domReady! plugin in your require() function. This ensured that the code in the function that was passed as the second argument only executes when everything is in place. This function is known as an initialization function:

require(["esri/map", "dojo/domReady!"], function(Map) {
// initialization goes here
});

You use your initialization function to create your map, add layers, and perform any other setup routines necessary to start your application.

Creating a map is invariably one of the first things that you'll do and in this section we...

Working with map service layers

A map without data layers is like an artist with a blank canvas. The data layers that you add to your map give it meaning and set the stage for analysis. These data layers come from map services published by ArcGIS Server and, occasionally, other GIS servers. The two main types of layers available from ArcGIS Server are dynamic map service layers and tiled (or cached) map service layers.

Dynamic map service layers reference map services that create a map image on the fly and then return the image to the application. This type of map service may be composed of one or more layers of information. For example, the Demographics map service displayed in the following screenshot is composed of nine different layers representing demographic information at various levels of geography:

While they can take somewhat longer to display in a client application...

Map events

In programming, events are actions that take place within an application. Normally these events are triggered by the end user and can include things like mouse clicks, mouse drags, keyboard actions, and others, but can also include the sending and receiving of data, changes in state of a user interface component, and many other scenarios.

The ArcGIS API for JavaScript is an asynchronous API that follows a publish/subscribe pattern wherein an application registers (publishes) events with listeners (subscribers). The following diagram illustrates this process. Listeners are responsible for monitoring the application for these events and then triggering a handler function that responds to the event. Multiple events can be registered to the same listener. The dojo on() function creates a listener that associates an event to a handler function:

As you'll recall the...

Summary

We covered a lot of ground in this chapter. All applications created with the ArcGIS API for JavaScript require you to perform certain steps. These include defining references to the API and style sheet, loading modules, creating an initialization function, and so on. In the initialization function you will most likely create an instance of the Map class, add various layers, and perform other setup operations that need to be performed before the application is used. In this chapter you learned how to perform these tasks.

In addition, we examined the various types of layers that can be added to a map including tiled map service layers and dynamic map service layers. Tiled map service layers are pre-created and cached on the server and are most often used as basemaps in an application. Dynamic map service layers must be created on the fly each time a request is made and...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • • Develop ArcGIS Server applications with JavaScript, both for traditional web browsers as well as the mobile platform
  • • Make your maps informative with intuitive geographic layers, user interface widgets, and more
  • • Integrate ArcGIS content into your custom applications and perform analytics with the ArcGIS Online

Description

The ArcGIS API for JavaScript enables you to quickly build web and mobile mapping applications that include sophisticated GIS capabilities, yet are easy and intuitive for the user. Aimed at both new and experienced web developers, this practical guide gives you everything you need to get started with the API. After a brief introduction to HTML/CSS/JavaScript, you'll embed maps in a web page, add the tiled, dynamic, and streaming data layers that your users will interact with, and mark up the map with graphics. You will learn how to quickly incorporate a broad range of useful user interface elements and GIS functionality to your application with minimal effort using prebuilt widgets. As the book progresses, you will discover and use the task framework to query layers with spatial and attribute criteria, search for and identify features on the map, geocode addresses, perform network analysis and routing, and add custom geoprocessing operations. Along the way, we cover exciting new features such as the client-side geometry engine, learn how to integrate content from ArcGIS.com, and use your new skills to build mobile web mapping applications. We conclude with a look at version 4 of the ArcGIS API for JavaScript (which is being developed in parallel with version 3.x) and what it means for you as a developer.

Who is this book for?

If you are a web or mobile application developer, who wants to create GIS applications in your respective platform, this book is ideal for you. You will need Java Script programming experience to get the most out of this book. Although designed as an introductory to intermediate level book, it will also be useful for more advanced developers who are new to the topic of developing applications with ArcGIS Server.

What you will learn

  • • To create an application with the ArcGIS API for JavaScript
  • • Build and display a broad range of different geometry types to represent features on the map
  • • The best way to leverage a feature layer and display related attribute data
  • • The functionality of the wide range of widgets and how to use them effectively
  • • Query data to gain new insights into the information it contains
  • • Work with tasks to discover and locate features on the map
  • • Using the geocoder and associated widgets
  • • The ability of the API to provide turn by turn directions and routing capabilities
  • • How to use the Geometry Engine and Geometry Service tasks for common geoprocessing operations
  • • Integrate content on ArcGIS online and add it to your custom web mapping application

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Oct 24, 2017
Length: 324 pages
Edition : 2nd
Language : English
ISBN-13 : 9781787280359
Category :
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Oct 24, 2017
Length: 324 pages
Edition : 2nd
Language : English
ISBN-13 : 9781787280359
Category :
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
AU$24.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
AU$249.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just AU$5 each
Feature tick icon Exclusive print discounts
AU$349.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just AU$5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total AU$ 227.97
Building Web and Mobile ArcGIS Server Applications with JavaScript ??? Second Edition
AU$75.99
Mastering ArcGIS Enterprise Administration
AU$75.99
ArcPy and ArcGIS
AU$75.99
Total AU$ 227.97 Stars icon
Banner background image

Table of Contents

14 Chapters
Introduction to HTML, CSS, and JavaScript Chevron down icon Chevron up icon
Creating Maps and Adding Layers Chevron down icon Chevron up icon
Adding Graphics to the Map Chevron down icon Chevron up icon
The Feature Layer Chevron down icon Chevron up icon
Using Widgets and Toolbars Chevron down icon Chevron up icon
Performing Spatial and Attribute Queries Chevron down icon Chevron up icon
Identifying and Finding Features Chevron down icon Chevron up icon
Turning Addresses into Points and Points into Addresses Chevron down icon Chevron up icon
Directions and Routing Chevron down icon Chevron up icon
Geoprocessing Tasks Chevron down icon Chevron up icon
Geometry Operations Chevron down icon Chevron up icon
Integration with ArcGIS Online Chevron down icon Chevron up icon
Creating Mobile Applications Chevron down icon Chevron up icon
Looking Ahead - Version 4 of the ArcGIS API for JavaScript Chevron down icon Chevron up icon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.