O'Reilly logo

OpenLayers 3 : Beginner's Guide by Erik Hazzard, Paul Spencer, Thomas Gratier

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

Time for action – using breakpoints to explore your code

Breakpoints help you understand available variables and their values, one at a time in your code, and see when the code is executed. Let's see how.

As we didn't have space to cover such a large topic, we chose to let you discover the basic parts using the official tutorial. So head to it and review it at https://developers.google.com/chrome-developer-tools/docs/javascript-debugging. Now after this review, open the example for Chapter 1, Getting Started with OpenLayers, with Chrome Developer Tools opened with the Sources panel. Change the ol.js reference to ol-debug.js (more readable).

Set breakpoints in the HTML page at var osmLayer, var map, map.addLayer, and map.setView. Check the following ...

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