Book Image

OpenLayers 3.x Cookbook - Second Edition

By : Peter J. Langley, Antonio Santiago Perez
Book Image

OpenLayers 3.x Cookbook - Second Edition

By: Peter J. Langley, Antonio Santiago Perez

Overview of this book

OpenLayers 3 is one of the most important and complete open source JavaScript mapping libraries today. Throughout this book, you will go through recipes that expose various features of OpenLayers 3, allowing you to gain an insight into building complex GIS web applications. You will get to grips with the basics of creating a map with common functionality and quickly advance to more complicated solutions that address modern challenges. You will explore into maps, raster and vector layers, and styling in depth. This book also includes problem solving and how-to recipes for the most common and important tasks.
Table of Contents (14 chapters)
OpenLayers 3.x Cookbook Second Edition
About the Authors
About the Reviewer

Adding features from a WFS server

The Web Feature Service (WFS) is an OGC standard that provides independent platform calls to request geographical features to a server. In practice, this means that a client makes an HTTP request to a server that implements the WFS standard and gets a set of features in varying formats, typically GML (Geographic Markup Language,


If you want to learn more about this, there is a complete specification on the OGC site, From the OpenLayers point of view, the WFS is nothing more than another data source that we can read to fill a vector layer.

Before continuing, there is an important point to take into account. Most of the requests made by OpenLayers when data is loaded, such as GML, KML, or GeoJSON files, are made asynchronously through AJAX requests.

Any JavaScript call is limited by the security model imposed by the browser, which avoids cross-domain requests...