Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
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
Free Trial
Paperback Oct 2017 324 pages 2nd Edition
eBook
₱1571.99 ₱2245.99
Paperback
₱2806.99
Subscription
Free Trial
Arrow left icon
Profile Icon Mark Lewin Profile Icon Eric Pimpler
Arrow right icon
Free Trial
Paperback Oct 2017 324 pages 2nd Edition
eBook
₱1571.99 ₱2245.99
Paperback
₱2806.99
Subscription
Free Trial
eBook
₱1571.99 ₱2245.99
Paperback
₱2806.99
Subscription
Free Trial

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
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 : 9781787280526
Category :
Languages :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

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

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.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
$199.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 ₱260 each
Feature tick icon Exclusive print discounts
$279.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 ₱260 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 8,420.97
Building Web and Mobile ArcGIS Server Applications with JavaScript ??? Second Edition
₱2806.99
Mastering ArcGIS Enterprise Administration
₱2806.99
ArcPy and ArcGIS
₱2806.99
Total 8,420.97 Stars icon

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

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.