0.0.7 • Published 2 years ago

ya-locator-plugin v0.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

ya-locator-plugin

Plug-in for the capacitor to determine the location of the device according to cellular and Wi-Fi networks via Yandex locator without using GPS

Only android

Install

npm install ya-locator-plugin
npx cap sync

API

requestCoordinates(...)

requestCoordinates(options: { version: string; url: string; api_key: string; }) => Promise<{ version: string; url: string; api_key: string; }>
ParamType
options{ version: string; url: string; api_key: string; }

Returns: Promise<{ version: string; url: string; api_key: string; }>


Listener

Plugin emitting event "currentLocation" current coordinates mobile device

{ "position": { "latitude": 55.743675, "longitude": 37.5646301, "altitude": 0.0, "precision": 701.71643, "altitude_precision": 30.0, "type": "gsm" } }

Add listener in your code

(VerYaLocator as any).addListener('currentLocation', (data: any) => { console.log('currentLocation', data); })