Book Image

Developing Mobile Web ArcGIS Applications

Book Image

Developing Mobile Web ArcGIS Applications

Overview of this book

Table of Contents (14 chapters)
Developing Mobile Web ArcGIS Applications
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

Mobile is transforming the GIS industry. Today, the demand from users of mobile devices for maps and location-based information is skyrocketing. ArcGIS is the most widely used GIS platform, with JavaScript as the most popular ArcGIS API. Esri's JavaScript team have been building a rich set of tools for developing ArcGIS Web applications.

This book will teach you how to build web-based mobile applications using the ArcGIS API for JavaScript.

What this book covers

Chapter 1, Introduction to Mobile Web ArcGIS Development, covers some of the core elements of developing mobile ArcGIS applications. We discuss how mobile web development is different from traditional web development. These differences include screen size, user interaction, design, functionality, and user and performance considerations. Mobile browsers and different development frameworks are also considered in this chapter.

Chapter 2, Understanding Mobile Frameworks and APIs, discusses some of the basic tools that are used for mobile web development; this includes popular frameworks and design paradigms. Dojo and jQuery mobile are both covered. In addition, simple code examples are included. We finish the chapter with an introduction to responsive, multi-device design and the Geolocation API.

Chapter 3, Building Your First Mobile ArcGIS Application, covers coding using the ArcGIS API. We introduce key tools, including Chrome's DevTools and the local web server installation. Starting with a brief review of basic coding elements, including HTML5, CSS3, and viewport, the bulk of this chapter walks you through code. We move from a very basic ArcGIS mobile application and evolve this code to include an ArcGIS map layer overlay and zooming to a users current location using geolocation.

Chapter 4, Advancing the Basic Mobile ArcGIS Application, is a natural progression from the previous chapter. We advance our mobile ArcGIS knowledge by adding more advanced functionality to our base application. This includes adding popular tools such as feature popups, a legend, finding features, and address search. At the completion of this chapter, you will have progressed from a basic to a more advanced understanding of ArcGIS mobile web development.

Chapter 5, Providing Cross-device Support with Responsive Design, Shows how to build mobile ArcGIS applications which run on all mobile devices. Here we introduce the idea of responsive design using the popular Bootstrap framework. We start with some of the key concepts, then start coding. We not only walk through the development of cross-device ArcGIS web applications with Bootstrap, but also evolve the base application to include a number of popular tools.

Chapter 6, Integration with ArcGIS Online, will focus on ArcGIS Online webmaps. So far, we worked with individual ArcGIS published services. Here, we will build a mobile ArcGIS application that works directly with ArcGIS Online. The application that we evolve in this chapter will include authentication and a webmap list and it will load a user-selected webmap.

Chapter 7, Developing Hybrid ArcGIS Mobile Applications with PhoneGap, demonstrates the flexibility of building mobile applications with the ArcGIS JavaScript API. We can not only build mobile applications that run in browsers, but also convert these applications to hybrid or installable apps that can be distributed to the various mobile app stores. In this chapter, we will provide guidance on working with PhoneGap and Cordova. We will not only go through setup, but also build a basic ArcGIS hybrid mobile application.

What you need for this book

To complete the exercises in this book, you will need access to a web browser, preferably Google Chrome. A text editor such as the free NotePad++ will be required to work with the many code samples. We recommend that you test these code samples using a locally running web server such as Apache or Internet Information Server(IIS). The majority of examples will access the publicly available instances of ArcGIS Server, so it will not be necessary for you to install the ArcGIS Server. You will need a free developer ArcGIS Online account for the ArcGIS Online discussion in Chapter 6, Integration with ArcGIS Online.

Who this book is for

This book targets GIS professionals who would like to learn how to create mobile web ArcGIS applications. It is primarily oriented towards beginners and intermediate-level GIS developers, and application developers who are interested in, or have been tasked with, implementing mobile Web ArcGIS solutions. The focus of the book will be on the ArcGIS API for JavaScript; for this, prior experience will be helpful but it is not required. Mobile applications will be built for both ArcGIS Server and ArcGIS Online; again, no prior experience is required for this.

Conventions

In this book, you will find a number of styles of text 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: "Mobile developers will need to use require() to load any of the additional modules."

A block of code is set as follows:

<script>
  require(["esri/map", "dojo/domReady!"],
    function(Map){
    });
</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:

    if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(showPosition);
    } else {
        x.innerHTML = "Geolocation is not supported by this browser.";
    }

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

>npm install cordova –save

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "When you click on the sign-in button, it redirects you to the OAuth Log in page."

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 may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via 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 on 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 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 files e-mailed directly to you.

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 would 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 on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright 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

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.