O'Reilly logo

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

HTML5 Geolocation

Book Description

Truly revolutionary: now you can write geolocation applications directly in the browser, rather than develop native apps for particular devices. This concise book demonstrates the W3C Geolocation API in action, with code and examples to help you build HTML5 apps using the "write once, deploy everywhere" model. Along the way, you get a crash course in geolocation, browser support, and ways to integrate the API with common geo tools like Google Maps. Ideal for experienced JavaScript developers.

  • Learn how geo information is gathered from different sources, depending on the device
  • Discover how coordinate systems work, including geodetic systems and datums
  • Use the API to collect location information from a user’s browser with JavaScript code
  • Place geo information on a map using the Google Maps or ArcGIS JavaScript APIs
  • Save geo data with databases, the Keyhole Markup Language, or the shapefile format
  • Be familiar with several practical uses for geo data, such as geomarketing, geosocial, geotagging, and geo-applications

Table of Contents

  1. Dedication
  2. Preface
    1. Audience for This Book
    2. Conventions Used in This Book
    3. Using Code Examples
    4. Safari® Books Online
    5. How to Contact Us
    6. Acknowledgments
  3. 1. Finding Our Way
    1. Geolocation in the Past
      1. Location B.C.E.
      2. Technology with Exploration
      3. Location in the 1900s
    2. Public Availability of GPS
    3. Geolocation Now
    4. The Basics
    5. Ways to Locate
      1. Global Positioning System (GPS)
      2. IP Address
      3. GSM/CDMA Cell IDs
      4. WiFi and Bluetooth MAC Address
    6. Location and Location-Based Services (LBS)
    7. Geolocation Today
      1. Mobile Applications
        1. Social Media Applications
        2. Location-sharing Applications
      2. Augmented Reality Applications
  4. 2. Geolocation: Latitude, Longitude, and More
    1. What Are Coordinate Systems?
      1. Latitude and Longitude
        1. Decimal Degrees versus Degrees Minutes Seconds
        2. Conversion: DMS to Decimal Degrees
        3. Conversion: Decimal Degrees to DMS
    2. Geodetic Systems and Datums
      1. The Earth’s Shape
      2. Common Datum
        1. WGS 84
      3. Map Projections
    3. Altitude, Course, and Speed
      1. Geodetic Height
        1. Vertical Datum
      2. Course
      3. Speed
    4. Accuracy
  5. 3. Geolocation API in Code
    1. W3C Geolocation API
      1. Current API Support
      2. Other Browser Solutions
        1. Gears
        2. Other Mobile APIs
        3. geo-location-javascript
    2. The W3C Geolocation API Does More
    3. The Geolocation Object
    4. Get the User’s Position
      1. PositionOptions
      2. Cached Positions
    5. Update the User’s Position
      1. No Need for Polling
      2. Clearing a Watch Operation
    6. Handling a Successful Request
      1. Position Object
      2. Coordinates Object
    7. Handling an Error from the Request
      1. PositionError Object
    8. Privacy
  6. 4. Geolocation and Mapping APIs
    1. A Google Maps Example
      1. The Google Maps API, Briefly
        1. Map Options
      2. Adding Geolocation to Google Maps
        1. Adding Geolocation for Other Browsers
    2. An ArcGIS JavaScript API Example
      1. The ArcGIS JavaScript API, Briefly
      2. Adding Geolocation to Esri Maps
        1. Support for Other Browsers
  7. 5. Saving Geographic Information
    1. KML
    2. Shapefiles
      1. Python Shapefile Library
    3. Databases
      1. SDE
      2. PostGIS
      3. MySQL
  8. 6. What You Can Do with Geolocation
    1. Geomarketing
      1. Specials and Offers
      2. Crowdsourcing
      3. Specialization
    2. Geosocial
      1. Continued Growth
      2. Automatic Check-in
      3. Two Way Street of Data
    3. Geotagging
      1. Digital Media and Geotagging
      2. Privacy and Geotagging
    4. Geo-applications
      1. Safety/Tracking
      2. Taxi Services
      3. Search
      4. M-Commerce
      5. Other Applications
    5. HTML5 and Geolocation
      1. Web Applications Supplementing LBS
      2. Web-Based LBS
  9. About the Author
  10. Copyright