# cordova-mock-geolocation-plugin

> Cordova Mock Geolocation Plugin

Latest version **1.0.4** (published 2017-05-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install cordova-mock-geolocation-plugin
pnpm add cordova-mock-geolocation-plugin
yarn add cordova-mock-geolocation-plugin
bun add cordova-mock-geolocation-plugin
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2017-05-09 |
| First published | 2017-05-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | ArcGEO |
| Maintainers | tomasvoj |
| Keywords | cordova, geolocation, mock, cordova-android |

## Links

- npm: https://www.npmjs.com/package/cordova-mock-geolocation-plugin
- Repository: https://github.com/ArcGEO/cordova-mock-geolocation-plugin
- Homepage: https://github.com/ArcGEO/cordova-mock-geolocation-plugin#readme
- Issues: https://github.com/ArcGEO/cordova-mock-geolocation-plugin/issues
- npm.io page: https://npm.io/package/cordova-mock-geolocation-plugin

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2017-05-09

## README

[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)

Tested on: Android 4.4.2, 5.0, 5.1.1, 6.0, 6.0.1, 7.0

# Cordova Mock Geolocation Plugin

Plugin that mocks geolocation into Android device, e.g. from external GPS Bluetooth device. Plugin has been tested on Android 4.4.2 and Android 6.0

## Using
    
Install the plugin:

    $ cordova plugin add https://github.com/ArcGEO/cordova-mock-geolocation-plugin.git   

In your cordova application:

```js
    var latitude = -26.902038;
    var longitude = -48.671337;
    var accuracy = 1;
    var altitude = 0;
    
    mockGeolocation.setMock([latitude, longitude, accuracy, altitude], function(suc){
          console.log(suc);
        }, function(err){
          console.log(err);
        });
```

## Permissions

For Android Marshmellow, you need to allow your app to mock location (in developer tools).

Follow: [Allow mock location on Android M](https://www.youtube.com/watch?v=CWfIBqjP1kA)

## API

### mockGeolocation.setMock([latitude, longitude, accuracy, altitude], successCallback, errorCallback)</code>

Mocks input parameters as your device location.

## TODO

* Add more parameters
* Add samples

---
_Source: https://npm.io/package/cordova-mock-geolocation-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
