{"_id":"ng2-haversine","_rev":"38-20009b8c1e799f257875bed704301c23","name":"ng2-haversine","description":"An Angular 2 library to calculate the distance between a pair of coordinates using the Haversine formula.","dist-tags":{"latest":"0.1.1"},"versions":{"0.0.1":{"name":"ng2-haversine","version":"0.0.1","description":"An Angular 2 module that applies the Haversine formula to a pair of coordinates to calculate the distance between them.","repository":{"type":"git","url":"git+https://github.com/vermicida/ng2-haversine.git"},"keywords":["angular2","ng2","haversine"],"author":{"name":"Diego Herrera","email":"vermicida@gmail.com"},"scripts":{"tsc":"rm -rf ./dist && tsc","typings":"typings"},"license":"MIT","bugs":{"url":"https://github.com/vermicida/ng2-haversine/issues"},"homepage":"https://github.com/vermicida/ng2-haversine#readme","devDependencies":{"@angular/core":"^2.0.1","rxjs":"^5.0.0-beta.12","typescript":"^2.0.3","typings":"^1.4.0","zone.js":"^0.6.25"},"_id":"ng2-haversine@0.0.1","_shasum":"599b2055ad912b81e42a1a9067fd3707a2fe9345","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.6.0","_npmUser":{"name":"vermicida","email":"vermicida@gmail.com"},"dist":{"shasum":"599b2055ad912b81e42a1a9067fd3707a2fe9345","tarball":"https://registry.npmjs.org/ng2-haversine/-/ng2-haversine-0.0.1.tgz","integrity":"sha512-JJMMDG+6nMeOdV5gsuccBQOGWMcTzs9QQalP7MQxxHTqIusQmbZQjbHVRLuTF2wLLkvyQadvbroSzgu1Q3NmYA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDWV0xJRr8dnBXv/k4T3dkzX7hoWpvLTVc0zfOWfffPoAiEAra/5ZW0E+2MWH3B2ULeVr8eb5BXQlCss9yp5NtIMg8E="}]},"maintainers":[{"name":"vermicida","email":"vermicida@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/ng2-haversine-0.0.1.tgz_1475491319821_0.21842503547668457"},"deprecated":"Testing version. Use 0.1.0 or greater."},"0.0.2":{"name":"ng2-haversine","version":"0.0.2","description":"An Angular 2 library to calculate the distance between a pair of coordinates using the Haversine formula.","repository":{"type":"git","url":"git+https://github.com/vermicida/ng2-haversine.git"},"keywords":["angular2","ng2","haversine"],"author":{"name":"Diego Herrera","email":"vermicida@gmail.com"},"scripts":{"tsc":"rm -rf ./dist && tsc","typings":"typings"},"license":"MIT","bugs":{"url":"https://github.com/vermicida/ng2-haversine/issues"},"homepage":"https://github.com/vermicida/ng2-haversine#readme","devDependencies":{"@angular/core":"^2.0.1","rxjs":"^5.0.0-beta.12","typescript":"^2.0.3","typings":"^1.4.0","zone.js":"^0.6.25"},"_id":"ng2-haversine@0.0.2","_shasum":"dd3f72e0c5c69f4a6d0cbc15d8f608dfe151aa0b","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.6.0","_npmUser":{"name":"vermicida","email":"vermicida@gmail.com"},"dist":{"shasum":"dd3f72e0c5c69f4a6d0cbc15d8f608dfe151aa0b","tarball":"https://registry.npmjs.org/ng2-haversine/-/ng2-haversine-0.0.2.tgz","integrity":"sha512-zBYB2F+WqMZ7Fj0InxE/kFm165pYoO75/HHhCNPKXbPFQTUSINBL5UXw8DJoWILXHC+w5eAEFbAHj/RBXUjeZA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB3DkjJLv61t3SJXE0DcZ+rnhhBwMgSH48LBGrFDx951AiEA7ag3vupNQZTfBBzGLS6bPyIIxfLD4A6ivQnJBBkR0wA="}]},"maintainers":[{"name":"vermicida","email":"vermicida@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/ng2-haversine-0.0.2.tgz_1475492233469_0.5920765204355121"},"deprecated":"Testing version. Use 0.1.0 or greater."},"0.0.3":{"name":"ng2-haversine","version":"0.0.3","description":"An Angular 2 library to calculate the distance between a pair of coordinates using the Haversine formula.","repository":{"type":"git","url":"git+https://github.com/vermicida/ng2-haversine.git"},"keywords":["angular2","ng2","haversine"],"author":{"name":"Diego Herrera","email":"vermicida@gmail.com"},"scripts":{"tsc":"rm -rf ./dist && tsc","typings":"typings"},"license":"MIT","bugs":{"url":"https://github.com/vermicida/ng2-haversine/issues"},"homepage":"https://github.com/vermicida/ng2-haversine#readme","devDependencies":{"@angular/core":"^2.0.1","rxjs":"^5.0.0-beta.12","typescript":"^2.0.3","typings":"^1.4.0","zone.js":"^0.6.25"},"_id":"ng2-haversine@0.0.3","_shasum":"642c6e11b6b564504acace981bf1d0f511cff744","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.6.0","_npmUser":{"name":"vermicida","email":"vermicida@gmail.com"},"dist":{"shasum":"642c6e11b6b564504acace981bf1d0f511cff744","tarball":"https://registry.npmjs.org/ng2-haversine/-/ng2-haversine-0.0.3.tgz","integrity":"sha512-pB0u3zwmEGBc12fmoNj15yYmbrti/HSt9dik3VMz1PZRnsTXwPqqbiVrx3PvKFL3dKi/WeVtIMrtpcg1Bu48IA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFITxEw6YYWqh8HoMt1H5vD8pUu3HCdZjeiT4vIqmP6pAiEAkuy3vNhtx9+Q1TcrvImgALwx6AqGj0/zr+tIOkLbeQI="}]},"maintainers":[{"name":"vermicida","email":"vermicida@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/ng2-haversine-0.0.3.tgz_1475492480584_0.3891969055403024"},"deprecated":"Testing version. Use 0.1.0 or greater."},"0.0.4":{"name":"ng2-haversine","version":"0.0.4","description":"An Angular 2 library to calculate the distance between a pair of coordinates using the Haversine formula.","repository":{"type":"git","url":"git+https://github.com/vermicida/ng2-haversine.git"},"keywords":["angular2","ng2","haversine"],"author":{"name":"Diego Herrera","email":"vermicida@gmail.com"},"scripts":{"tsc":"rm -rf ./dist && tsc","typings":"typings"},"license":"MIT","bugs":{"url":"https://github.com/vermicida/ng2-haversine/issues"},"homepage":"https://github.com/vermicida/ng2-haversine#readme","devDependencies":{"@angular/core":"^2.0.1","rxjs":"^5.0.0-beta.12","typescript":"^2.0.3","typings":"^1.4.0","zone.js":"^0.6.25"},"_id":"ng2-haversine@0.0.4","_shasum":"8d23ed1e3c3b989c3deae53ec8fdde9747a2b43c","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.6.0","_npmUser":{"name":"vermicida","email":"vermicida@gmail.com"},"dist":{"shasum":"8d23ed1e3c3b989c3deae53ec8fdde9747a2b43c","tarball":"https://registry.npmjs.org/ng2-haversine/-/ng2-haversine-0.0.4.tgz","integrity":"sha512-uL3VeEFrA0scXIj1KYA+N/5bHhdfltbDjSi95L1l6Cmfk7NsZVVsKDrT+sQtW7TLZn7hblOhJpOiQpcnVmteCQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDZxICLBVaAXuPJLWTx1ISXDhAqn6hx/f55X2jt3XNowAiAsy65zeCk7pw5D92bhnesHvq2xX8/NlxNtDCBufN3V4w=="}]},"maintainers":[{"name":"vermicida","email":"vermicida@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/ng2-haversine-0.0.4.tgz_1475492708377_0.6982422277797014"},"deprecated":"Testing version. Use 0.1.0 or greater."},"0.0.5":{"name":"ng2-haversine","version":"0.0.5","description":"An Angular 2 library to calculate the distance between a pair of coordinates using the Haversine formula.","repository":{"type":"git","url":"git+https://github.com/vermicida/ng2-haversine.git"},"keywords":["angular2","ng2","haversine"],"author":{"name":"Diego Herrera","email":"vermicida@gmail.com"},"scripts":{"tsc":"rm -rf ./dist && tsc","typings":"typings"},"license":"MIT","bugs":{"url":"https://github.com/vermicida/ng2-haversine/issues"},"homepage":"https://github.com/vermicida/ng2-haversine#readme","devDependencies":{"@angular/core":"^2.0.1","rxjs":"^5.0.0-beta.12","typescript":"^2.0.3","typings":"^1.4.0","zone.js":"^0.6.25"},"_id":"ng2-haversine@0.0.5","_shasum":"ab855d7b0e22c8296ad063d32fe7f7a8e8d1e0f5","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.6.0","_npmUser":{"name":"vermicida","email":"vermicida@gmail.com"},"dist":{"shasum":"ab855d7b0e22c8296ad063d32fe7f7a8e8d1e0f5","tarball":"https://registry.npmjs.org/ng2-haversine/-/ng2-haversine-0.0.5.tgz","integrity":"sha512-10dQj/pGOvUXPf53rSt72y1xRBGiVhLc0aSAygAwT+gwbqXdcVgcxHxoUFU5djMvvUpR5mOmAA4/L4QSYEdmMg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC7u5660q2IGRBovgVB4Lnk6RHgt8EUVaW1KLJMHOhZNAiBz3raV/gb8m3qLIlH2xQZ/3hmnKLsLquhO5rgdcd7jQA=="}]},"maintainers":[{"name":"vermicida","email":"vermicida@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/ng2-haversine-0.0.5.tgz_1475493070053_0.3500118216034025"},"deprecated":"Testing version. Use 0.1.0 or greater."},"0.0.6":{"name":"ng2-haversine","version":"0.0.6","description":"An Angular 2 library to calculate the distance between a pair of coordinates using the Haversine formula.","repository":{"type":"git","url":"git+https://github.com/vermicida/ng2-haversine.git"},"keywords":["angular2","ng2","haversine"],"author":{"name":"Diego Herrera","email":"vermicida@gmail.com"},"scripts":{"tsc":"rm -rf ./dist && tsc","typings":"typings"},"license":"MIT","bugs":{"url":"https://github.com/vermicida/ng2-haversine/issues"},"homepage":"https://github.com/vermicida/ng2-haversine#readme","devDependencies":{"@angular/core":"^2.0.1","rxjs":"^5.0.0-beta.12","typescript":"^2.0.3","typings":"^1.4.0","zone.js":"^0.6.25"},"_id":"ng2-haversine@0.0.6","_shasum":"418a211d31acda76f096066781f4ee7cd03e232d","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.6.0","_npmUser":{"name":"vermicida","email":"vermicida@gmail.com"},"dist":{"shasum":"418a211d31acda76f096066781f4ee7cd03e232d","tarball":"https://registry.npmjs.org/ng2-haversine/-/ng2-haversine-0.0.6.tgz","integrity":"sha512-PUkfZn39R/ctpM4eiMTcr7a4fbn88gTgV01iI2mvqD9vq8oG5RPldTOYw0XDxg6HrgGlnLl0WPFt6SNFi6liaw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTxxq7O5x48+lNb+fS2fygPb7t2t0hy81ft7wSIdg24wIga2/9cwFBa2NLdYzxDfzje75abH4Od76qBAjYRPMagV0="}]},"maintainers":[{"name":"vermicida","email":"vermicida@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/ng2-haversine-0.0.6.tgz_1475493852209_0.40929789608344436"},"deprecated":"Testing version. Use 0.1.0 or greater."},"0.1.0":{"name":"ng2-haversine","version":"0.1.0","description":"An Angular 2 library to calculate the distance between a pair of coordinates using the Haversine formula.","repository":{"type":"git","url":"git+https://github.com/vermicida/ng2-haversine.git"},"keywords":["angular2","ng2","haversine"],"author":{"name":"Diego Herrera","email":"vermicida@gmail.com"},"scripts":{"clean":"node ./src/clean.js","tsc":"tsc","typings":"typings"},"license":"MIT","bugs":{"url":"https://github.com/vermicida/ng2-haversine/issues"},"homepage":"https://github.com/vermicida/ng2-haversine#readme","devDependencies":{"@angular/core":"^2.0.2","rimraf":"^2.5.4","rxjs":"^5.0.0-beta.12","typescript":"^2.0.3","typings":"^1.4.0","zone.js":"^0.6.25"},"gitHead":"212f34d132c7fb7a6ded1fa04f9ad0b08956490d","_id":"ng2-haversine@0.1.0","_shasum":"28d20952fffeeaafc58b54866f0215658a2be526","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.6.0","_npmUser":{"name":"vermicida","email":"vermicida@gmail.com"},"dist":{"shasum":"28d20952fffeeaafc58b54866f0215658a2be526","tarball":"https://registry.npmjs.org/ng2-haversine/-/ng2-haversine-0.1.0.tgz","integrity":"sha512-CdCPe5+mK0QfZ0c9dLjSON5hH2y8vTgfZwG903NCkc4y4AyOh5gNidGt/ZXt6CkJI+59DyI27EpSYi//5nbJ0Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC9vjBvWFs61pFUUs/HXIaSYtxLuvWuif5+UCqA4lHQkAiEA2fqbj9DTIv1cKEu+7hysTCORtukGrFJ4sla7755rW64="}]},"maintainers":[{"name":"vermicida","email":"vermicida@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/ng2-haversine-0.1.0.tgz_1476039202101_0.7396769479382783"}},"0.1.1":{"name":"ng2-haversine","version":"0.1.1","description":"An Angular 2 library to calculate the distance between a pair of coordinates using the Haversine formula.","repository":{"type":"git","url":"git+https://github.com/vermicida/ng2-haversine.git"},"keywords":["angular2","ng2","haversine"],"author":{"name":"Diego Herrera","email":"vermicida@gmail.com"},"scripts":{"clean":"node ./src/clean.js","tsc":"tsc","typings":"typings"},"license":"MIT","bugs":{"url":"https://github.com/vermicida/ng2-haversine/issues"},"homepage":"https://github.com/vermicida/ng2-haversine#readme","devDependencies":{"@angular/core":"^2.0.2","rimraf":"^2.5.4","rxjs":"^5.0.0-beta.12","typescript":"^2.0.3","typings":"^1.4.0","zone.js":"^0.6.25"},"gitHead":"ff556e8d604173a92081947ca61c008439121a3e","_id":"ng2-haversine@0.1.1","_shasum":"17b1a41102bd33012717a40cc00020c2ee4e5292","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.6.0","_npmUser":{"name":"vermicida","email":"vermicida@gmail.com"},"dist":{"shasum":"17b1a41102bd33012717a40cc00020c2ee4e5292","tarball":"https://registry.npmjs.org/ng2-haversine/-/ng2-haversine-0.1.1.tgz","integrity":"sha512-BCh0G9A4rlb9+4ZZQrxurbHBVFclYQ+psfEzRrtnyG3h7Vlpc2sEufQwBPpdMs3HBwAIY/fRPvVN0wMLb1BpqA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDJ5jvWL7nQN1QpUmABn/jjt7tmHMww3Lpq3r7tLoEYGAiBqhgFB8ZX4UEJiaO4feEq9eAY3pQU2iWxYsxomICIdMQ=="}]},"maintainers":[{"name":"vermicida","email":"vermicida@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/ng2-haversine-0.1.1.tgz_1476040231534_0.028810415416955948"}}},"readme":"# ng2-haversine\n\n[![NPM](https://nodei.co/npm/ng2-haversine.png?compact=true)](https://nodei.co/npm/ng2-haversine/)\n\n[![npm version](https://badge.fury.io/js/ng2-haversine.svg)](https://badge.fury.io/js/ng2-haversine) [![Dependency Status](https://david-dm.org/vermicida/ng2-haversine.svg)](https://david-dm.org/vermicida/ng2-haversine)\n\nAn Angular 2 library to calculate the distance between a pair of coordinates using the Haversine formula.\n\n## Getting started\n\nInstall `ng2-haversine` using `npm` within your Angular 2 app directory:\n\n```bash\n$ npm install ng2-haversine --save\n```\n\nOnce the package is installed, set the provider for `HaversineService` in your `AppModule`:\n\n```typescript\nimport { HaversineService } from \"ng2-haversine\";\n\n@NgModule({\n    ...\n    providers: [HaversineService]\n    ...\n})\nexport class AppModule { }\n```\n\nNow you're ready to use `ng2-haversine`!\n\n## How to\n\nYou can use `HaversineService` from a Service or from a Component: just inject it as a dependency. Remember to import `GeoCoord` as well:\n\n```typescript\nimport { HaversineService, GeoCoord } from \"ng2-haversine\";\n\n@Component({ ... })\nexport class MyComponent {\n    constructor(private _haversineService: HaversineService) { }\n}\n```\n\nThen, use one of the provided functions in `HaversineService` to calcule the distance between two points:\n\n```typescript\ntryHaversine(): void {\n\n    let madrid: GeoCoord = {\n        latitude: 40.416775,\n        longitude: -3.703790\n    };\n\n    let bilbao: GeoCoord = {\n        latitude: 43.262985,\n        longitude: -2.935013\n    };\n\n    let meters = this._haversineService.getDistanceInMeters(madrid, bilbao);\n    let kilometers = this._haversineService.getDistanceInKilometers(madrid, bilbao);\n    let miles = this._haversineService.getDistanceInMiles(madrid, bilbao);\n\n    console.log(`\n        The distance between Madrid and Bilbao is:\n            - ${meters} meters\n            - ${kilometers} kilometers\n            - ${miles} miles\n    `);\n}\n```\n\nAs you have guessed:\n\n- `getDistanceInMeters(coord1: GeoCoord, coord2: GeoCoord): number` calculates a distance in meters.\n- `getDistanceInKilometers(coord1: GeoCoord, coord2: GeoCoord): number` calculates a distance in kilometers.\n- `getDistanceInMiles(coord1: GeoCoord, coord2: GeoCoord): number` calculates a distance in miles.\n- `GeoCoord` is an interface with `latitude: number` and `longitude: number`.\n\n## Using SystemJS\n\nTo load `ng2-haversine` using [SystemJS](https://github.com/systemjs/systemjs) is as simple as this. Open your `systemjs.config.js` file and set `paths`, `map` and `packages` properties this way:\n\n```javascript\n(function (global) {\n    System.config({\n        paths: {\n            \"npm:\": \"node_modules/\"\n        },\n        map: {\n            ...\n            \"ng2-haversine\": \"npm:ng2-haversine\"\n        },\n        packages: {\n            ...\n            \"ng2-haversine\": {\n                main: \"./index.js\",\n                defaultExtension: \"js\"\n            }\n        }\n    });\n})(this);\n```\n\nThat's it :)\n\n## License\n\nCode released under the [MIT license](./LICENSE).\n","maintainers":[{"name":"vermicida","email":"vermicida@gmail.com"}],"time":{"modified":"2022-06-21T05:44:31.304Z","created":"2016-10-03T10:42:01.559Z","0.0.1":"2016-10-03T10:42:01.559Z","0.0.2":"2016-10-03T10:57:14.904Z","0.0.3":"2016-10-03T11:01:22.458Z","0.0.4":"2016-10-03T11:05:09.769Z","0.0.5":"2016-10-03T11:11:11.811Z","0.0.6":"2016-10-03T11:24:13.618Z","0.0.7":"2016-10-09T10:41:28.640Z","0.0.8":"2016-10-09T10:57:25.306Z","0.0.9":"2016-10-09T11:11:34.877Z","0.0.10":"2016-10-09T11:19:21.694Z","0.0.11":"2016-10-09T11:27:15.672Z","0.0.12":"2016-10-09T11:34:11.943Z","0.0.13":"2016-10-09T11:34:29.408Z","0.0.14":"2016-10-09T11:41:56.690Z","0.0.15":"2016-10-09T17:22:52.879Z","0.0.16":"2016-10-09T17:34:59.413Z","0.0.17":"2016-10-09T17:37:39.826Z","0.0.18":"2016-10-09T18:00:54.179Z","0.1.0":"2016-10-09T18:53:24.000Z","0.1.1":"2016-10-09T19:10:32.147Z"},"homepage":"https://github.com/vermicida/ng2-haversine#readme","keywords":["angular2","ng2","haversine"],"repository":{"type":"git","url":"git+https://github.com/vermicida/ng2-haversine.git"},"author":{"name":"Diego Herrera","email":"vermicida@gmail.com"},"bugs":{"url":"https://github.com/vermicida/ng2-haversine/issues"},"license":"MIT","readmeFilename":"README.md"}