Book Image

OpenLayers 3: Beginner's Guide

By : Thomas Gratier, Paul Spencer, Erik Hazzard
Book Image

OpenLayers 3: Beginner's Guide

By: Thomas Gratier, Paul Spencer, Erik Hazzard

Overview of this book

<p>This book is a practical, hands-on guide that provides you with all the information you need to get started with mapping using the OpenLayers 3 library.</p> <p>The book starts off by showing you how to create a simple map. Through the course of the book, we will review each component needed to make a map in OpenLayers 3, and you will end up with a full-fledged web map application. You will learn the key role of each OpenLayers 3 component in making a map, and important mapping principles such as projections and layers. You will create your own data files and connect to backend servers for mapping. A key part of this book will also be dedicated to building a mapping application for mobile devices and its specific components.</p>
Table of Contents (22 chapters)
OpenLayers 3 Beginner's Guide
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Using a web server


Because we'll view the examples in this chapter on a mobile device with a browser that does not have direct access to your development machine, we'll need to serve them through a web server and access them using the HTTP protocol. Your computer also needs to be connected to the same Local Area Network (LAN) as your mobile device.

We've already been using a web server with the samples using the URL http://localhost/. This URL uses the name localhost, a special name that tells the web browser to connect to the local machine. This is great for your desktop browser, but it isn't going to work for our mobile device. You'll need to find the IP address of your computer on the LAN.

Finding your IP address on Windows

On Windows, open a command prompt (cmd.exe) and type ipconfig.

You should see something like the following screenshot:

The ipconfig command will output some information about your network connections; the actual output will be different depending on your setup and how you...