Book Image

Mastering OpenLayers 3

By : Gábor Farkas
Book Image

Mastering OpenLayers 3

By: Gábor Farkas

Overview of this book

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.
Table of Contents (17 chapters)
Mastering OpenLayers 3
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Validating attributes


Object-oriented databases lack one very important thing that relational databases have: consistency. As consistent data handling and relational database support is a very important consideration in GIS software (at least to support a server-side spatial database), we need to implement some restrictions in our data management system. In this example, called ch04_validation, we will extend our application with typed attributes and validation.

Tip

One possible solution for easy RDBMS support is using the Web SQL Database API. However, this API is deprecated and not supported by any of the Firefox and Microsoft browsers. In supported browsers, it uses an SQLite backend.

Adjusting the styles

As we are using a form for attribute management, we can harness its validating capability as we use typed attributes. For numeric fields, we will use a number input, which does not process strings. In non-Microsoft browsers, numeric fields also prevent us from submitting the form if it detects...