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 KML layer

The arrival of Google Maps leads to an explosion in the world of GIS and web mapping. Google introduced not only an API but also some file formats.

The Keyhole Markup Language (KML) had become one of the most extensively used formats, and finally it became an OGC standard.

Adding a KML layer

This recipe will show you how easy it is to add features from a KML file. You can find the necessary files in the KML format attached to the source code of this book available on the Packt Publishing website.

How to do it...

  1. Create an HTML file including the OpenLayers library and insert the following code in it. First, add the DOM element that will hold the map: ...

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