O'Reilly logo

OpenLayers Cookbook by Antonio Santiago Perez

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding a GML layer

The Geography Markup Language (GML) is an XML grammar used to express geographic features. It is an OGC standard and is very well accepted by the GIS community.

Adding a GML layer

In this recipe, we will show you how to create a vector layer from a GML file.

Note

You can find the necessary files in the GML format attached to the source code of this book on the Packt Publishing website.

How to do it...

  1. Create an HTML file with the required OpenLayers dependencies and insert the following code. First add the div element to hold the map:
    <!-- Map DOM element --> 
    <div id="ch3_gml" style="width: 100%; height: 100%;"></div> 
  2. Next, add the JavaScript code to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required