19,19 €
We don't just surf the Web from our desktops any more – we take it with us, everywhere we go. Modern devices contain sophisticated hardware and software to determine the user's location. Apps such as Foursquare and Google Maps use this to create new kinds of functionality. Now, you can do this too with the HTML5 Geolocation API.
"Instant HTML5 Geolocation How-to" is a simple guide to adding location information to your web applications. The practical, easy-to-follow recipes are designed to help you learn the ins and outs of the API. You'll learn how to use it, how it works, and how to save and display geographic information on the web.
Beginning with a solid grounding in how the Geolocation API works and when to use it, you will learn how to determine, store, display, and track the user's location via a series of clear recipes.
You will learn the different ways location is determined on different devices, including desktops and laptops that don't have GPS units. You'll also learn how to selectively use these different behaviours, based on the speed, accuracy, and battery life requirements of your application. You'll also get some hints about using MySQL databases to store sets of location data.
"Instant HTML5 Geolocation How-to" will teach you everything you need to know about retrieving the location information your application needs, across multiple devices and platforms.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 58
Veröffentlichungsjahr: 2013
Copyright © 2013 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: May 2013
Production Reference: 1160513
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78216-590-3
www.packtpub.com
Author
Ben Werdmuller
Reviewers
Mark DuBois
Matt West
Acquisition Editor
James Jones
Commissioning Editor
Sharvari Tawde
Technical Editor
Prasad Dalvi
Project Coordinator
Suraj Bist
Proofreader
Ting Baker
Cover Image
Shantanu Zagade
Production Coordinator
Aparna Bhagat
Cover Work
Aparna Bhagat
Ben Werdmuller is a web developer, product manager, and entrepreneur. He co-founded Elgg, an open source social networking platform used by organizations such as NASA, the World Bank, and Oxfam. Currently, he serves as the CTO of latakoo.com, an enterprise platform for sending, storing, and sharing videos and large files. He writes at benwerd.com.
I'd like to thank my family, and the web community. My career, let alone this book, wouldn't have been possible without both of them. I'm on an incredible journey, and I'm forever grateful.
Mark DuBois has been working with HTML since 1992. He built his first commercial website in 1995. Mark created the first accredited AAS degree in Web Systems and the first accredited certificate in rich Internet application development. Mark teaches many courses in web technologies at Illinois Central College. He has developed over 20 semester-long classes on various aspects of web design, development, and application security. His focus is on industry best practices regarding such items as security, accessibility, and web standards in these courses. He also serves as Director of Education for WebProfessionals.org and is recognized by Adobe as an Adobe Education Leader. Mark has recently taught numerous classes on HTML5, CSS3, and development of mobile apps using PhoneGap. He helps run both the Illinois and national web design contests for WebProfessionals.org (under the auspices of SkillsUSA). He can be found on Twitter (@Mark_DuBois) and posts articles on various aspects of web technology at http://blog.markdubois.info and http://blog.learning-html5.info.
Matt West is a developer and entrepreneur from Northampton, England. He previously founded the web development agency Developer City and is a contributor to a number of open source projects. Matt is currently working at his latest company, Koji Labs, which aims to create technological solutions for some of the world's biggest problems.
Matt is also the author of HTML5 Foundations (Wiley, 2012) and writes a blog at codingskyscrapers.com. You can find him on twitter as @MattAntWest.
You might want to visit www.PacktPub.com for support files and downloads related to your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.
Welcome to Instant HTML5 Geolocation How-to. This guide will help you make any web application aware of a user's location, quickly and easily. You will learn how to map a user's geographic location, integrate with popular mapping platforms, and track the user over time. In the process, you will create a simple application that generates a KML file containing both a path and points that you choose to save along that path (which can then be imported into Google Maps).
The iPhone changed the way we use the web. It was the first mobile device that included web browsing as a primary function. Suddenly, with mobile data and a phone like the iPhone, the web could be in your pocket, wherever you went. Through HTML5 and APIs, web applications could be truly context sensitive; they could know where you were, if you wanted them to, and react accordingly.
The Geolocation API is not part of HTML5, and is, instead, a JavaScript API standard. However, it sits alongside the evolving HTML5 specification as an important part of any modern web development toolkit.
Understanding the Geolocation API (Simple) discusses how the JavaScript Geolocation API works, when you should use it, and how it is implemented in different browsers and on different devices.
Setting up the application (Simple)
