geolocation-latlng

0.2.1 • Public • Published

geolocation-latlng

ES6 class to work with Geolocation API latitude and longitude

Installation

# NPM
npm install geolocation-latlng --save

# Yarn
yarn add geolocation-latlng

Getting Started

import { LatLng } from 'geolocation-latlng';
 
// Create an instance
let latLng = new LatLng(latitude, longitude);
 
// Pretty string methods available**
latlng.latitude.toString();
latLng.longitude.toString();
 
// Get distance to another coordinate
latLng.getDistanceTo(lat, lng);

** Latitude and longitude are instance of the Coordinate class. Many formatting and utility methods are available on latitude and longitude.

Credits

The LatLng API was inspired by the Google Maps API as well as MapBox's API.

License

MIT License Copyright (c) 2018 Joel Colucci

/geolocation-latlng/

    Package Sidebar

    Install

    npm i geolocation-latlng

    Weekly Downloads

    2

    Version

    0.2.1

    License

    MIT

    Unpacked Size

    145 kB

    Total Files

    11

    Last publish

    Collaborators

    • joelcolucci