Mastering OpenLayers 3
eBook - ePub

Mastering OpenLayers 3

  1. 308 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Mastering OpenLayers 3

Book details
Book preview
Table of contents
Citations

About This Book

Create powerful applications with the most robust open source web mapping library using this advanced guide

About This Book

  • Develop responsive and platform-independent web mapping applications with OpenLayers 3
  • Learn the key points of creating great applications with native JavaScript through the step-by-step examples
  • Master the use of the library, from compiling custom builds to developing a complete WebGIS application

Who This Book Is For

This book is intended for front-end developers with basic understanding of JavaScript and GIS concepts, and preferably for those who are familiar with the fundamentals of OpenLayers 3. You might have never used OpenLayers 3 as a seasoned JavaScript developer. If this is the case and you are eager to learn web mapping, this book will definitely set you on the right track.

What You Will Learn

  • Use the advanced functionality of the OpenLayers 3 library effectively
  • Implement the library in your application, shaping it to your needs
  • Manage layers and the layer stack dynamically
  • Create not only stunning but also accurate thematic maps
  • Extend OpenLayers 3 with your own custom classes
  • Develop mobile-friendly web mapping applications
  • Make stunning effects with canvas manipulation, or visualize point clouds with WebGL
  • Integrate third-party applications, and create custom builds that completely satisfy your needs

In Detail

OpenLayers 3 allows you to create stunning web mapping and WebGIS applications. It uses modern, cutting edge browser technologies. It is written with Closure Library, enabling you to build browser-independent applications without painful debugging ceremonies, which even have some limited fallback options for older browsers.

With this guide, you will be introduced to the world of advanced web mapping and WebGIS.

First, you will be introduced to the advanced features and functionalities available in OpenLayers 3. Next, you will be taken through the key points of creating custom applications with OpenLayers 3. You will then learn how to create the web mapping application of yours (or your company's) dream with this open source, expense-free, yet very powerful library. We'll also show you how to make amazing looking thematic maps and create great effects with canvas manipulation.

By the end of this book, you will have a strong command of web mapping and will be well on your way to creating amazing applications using OpenLayers 3.

Style and approach

This is an advanced guide packed with comprehensive examples, and it concentrates on the advanced parts of OpenLayers 3 and JavaScript. It intentionally skips the basic and well-known methodologies, but discusses the hard-to-understand ones in great detail.

Frequently asked questions

Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes, you can access Mastering OpenLayers 3 by Gabor Farkas in PDF and/or ePUB format, as well as other popular books in Informatica & Servizi web e API. We have over one million books available in our catalogue for you to explore.

Information

Year
2016
ISBN
9781785281006
Edition
1

Mastering OpenLayers 3


Table of Contents

Mastering OpenLayers 3
Credits
About the Author
About the Reviewer
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Creating Simple Maps with OpenLayers 3
Before getting started
Creating a working environment
Structure of OpenLayers 3
Building the layout
Creating the appeal
Writing the code
Using the API documentation
Understanding type definitions
Debugging the code
Summary
2. Applying Custom Styles
Before getting started
Basic considerations
Customizing the default appearance
Identifying the classes
Styling the controls
Customizing the attribution control
Creating a custom zoom control with CSS
Styling vector layers
Customizing the appearance with JavaScript
Changing the overview map and the scale bar
Truncating the coordinate control
Changing the attribution
Creating a WebGIS client layout
Building the HTML
Styling the layout
Writing the code
Summary
3. Working with Layers
Before getting started
Using a proxy
Resources to use
Basic considerations
Building a layer tree
Styling the layer tree
Creating a layer tree constructor
Adding layers dynamically
Creating the interface
Extending the constructor
Fetching the WMS metadata
Adding WMS layers
Adding WFS layers
WFS considerations
Adding vector layers with the File API
Creating the interface
Building the method
Adding vector layers with a library
Removing layers dynamically
Extending a constructor
Changing layer attributes
Styling active layers
Extending the method
Changing the layer order with the Drag and Drop API
Clearing the message bar
Summary
4. Using Vector Data
Before getting started
Accessing attributes
Writing the code
Setting attributes
Styling the form
Writing the code
Validating attributes
Adjusting the styles
Building headers
Writing the code
Creating thematic layers
Extending the layer tree
Creating choropleth maps
Creating categorized maps
Saving vector data
Saving in arbitrary formats
Saving with WFS-T
Modifying the geometry
Summary
5. Creating Responsive Applications with Interactions and Controls
Before getting started
Basic considerations
Building the toolbar
Mapping interactions to controls
Creating the control
Adding and removing the control
Adding a selection control
Building a set of feature selection controls
Styling the controls
Creating the selection tools
Adding new vector layers
Creating the HTML and the CSS
Extending the layer tree
Building a set of drawing tools
Writing the method
Modifying and snapping to features
Extending the method
Creating new interactions
Understanding ol.interaction.Pointer
Removing features
Dragging features
Extending the method
Building a measuring control
Creating the interaction
Doing geodesic measurements
Calculating lengths even more precisely
Summary
6. Controlling the Map – View and Projection
Before getting started
Basic considerations
Customizing a view
Constraining a view
Creating a navigation history
Working with extents
Creating a zoom control
Extending the toolbar
Rotating a view
Changing the map's projection
Creating custom animations
Building the control
Creating animations
Summary
7. Mastering Renderers
Before getting started
Using different renderers
Creating a WebGL map
Drawing lines and polygons with WebGL
Blending layers
Clipping layers
Exporting a map
Creating a raster calculator
Raster 101
Operating with pixels
Creating a convolution matrix
How convolution works
Converting an image to 8-bit
Implementing the Sobel filter
Normalizing an image
Finalizing a control
Clipping a layer with WebGL
Writing programs
Creating a clipping mask
Summary
8. OpenLayers 3 for Mobile
Before getting started
Basic considerations
Responsive styling with CSS
Writing the style sheet
Constructing the map
Generating geocaches
Adding device-dependent controls
Adding controls for touch devices
Adding controls for desktop computers
Vectorizing the mobile version
Making the mobile application interactive
Summary
9. Tools of the Trade – Integrating Third-Party Applications
Before getting started
Exporting a QGIS project
Installing the qgis2web plugin
Inspecting the project
Exporting a map
Salvaging the results
Importing shapefiles
Editing the HTML file
Replacing a function
Spatial analysis with Turf
Preparing an example
Implementing a buffer operation
Implementing a merge operation
Implementing the self-intersect operation
Spatial analysis with JSTS
Implementing operations
3D rendering with Cesium
Preparing a map
Creating a control
Observing a terrain
Extending the Cesium scene
Summary
10. Compiling Custom Builds with Closure
Before getting started
Configuring Node JS
Installing Node JS on Windows
Installing Node JS on Linux
Resolving dependencies
Compiling OpenLayers 3
Building default versions
Understanding a configuration file
Building OpenLayers 3 with a subset of features
Bundling an application with OpenLayers 3
Editing the application
Creating a configuration file
Fixing the application
Extending OpenLayers 3
Creating rich documentation with JSDoc
Customizing the documentation
Summary
Index

Mastering OpenLayers 3

Copyright © 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: January 2016
Production reference: 1220116
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78528-100-6
www.packtpub.com

Credits

Author
GĂĄbor Farkas
Reviewer
Jose Troche
Commissioning Editor
Veena Pagare
Acquisition Editor
Sonali Vernekar
Content Development Editor
Anish Dhurat
Technical Editor
Jayesh Sonawane
Copy Editors
Sonia Cheema
Trishya Hajare
Project Coordinator
Bijal Patel
Proofreader
Safis Editing
Indexer
Monica Ajmera Mehta
Graphics
Disha Haria
Production Coordinator
Conidon Miranda
Cover Work
Conidon Miranda

About the Author

GĂĄbor Farkas is a PhD student at University of PĂ©cs's Institute of Geography. He holds a master's degree in geography, although he moved from traditional geography to pure Geoinformatics early in his academic journey. He often studies Geoinformatical solutions in his free time, keeps up with the latest trends, and is an open source enthusiast. He loves to work with GRASS GIS, PostGIS, and QGIS, but his all-time favorites a...

Table of contents

  1. Mastering OpenLayers 3