This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@blinkmobile/geolocation

2.0.3 • Public • Published

geolocation.js Travis CI Status npm module

wrapper for HTML5 GeoLocation

Why?

We've noticed that different browsers (and web views) sometimes return a Position object that is incompatible with JSON.stringify(). Our wrapper fixes this problem.

Further, it also exposes a Promise API for people that prefer them.

Requirements

This library assumes ECMAScript 2015 support (including Promise). Be sure to shim these in older environments as required.

API

clonePosition(position)

  • @param {Position} position returned from GeoLocation API
  • @returns {Object} plain JavaScript object with the coordinate information
  • @throws {TypeError} if position or position.coords are not objects

getCurrentPosition(options)

  • @param {Object} [options]
  • @returns {Promise}

Promise style that is otherwise inspired by the W3C standard: http://dev.w3.org/geo/api/spec-source.html#api_description

Further Reading

Readme

Keywords

none

Package Sidebar

Install

npm i @blinkmobile/geolocation

Weekly Downloads

5

Version

2.0.3

License

BSD-3-Clause

Last publish

Collaborators

  • aaronroworth
  • blinkmobile-admin
  • kizaonline
  • mymattcarroll
  • simon_marklar