/react-native-compass

Native android compass library for react-native

Primary LanguageKotlinMIT LicenseMIT

@dhairyasharma/react-native-compass

Supports Android MIT License Maintenance Maintainer Generic badge

Twitter LinkedIn

Native android compass library for react-native

Only supports Android, for IOS work is in progress.

 

Getting started

Install the library using either Yarn:

yarn add @dhairyasharma/react-native-compass
yarn add react-native-shared-preferences@1.0.2

or npm:

npm install --save @dhairyasharma/react-native-compass
npm install --save eact-native-shared-preferences@1.0.2

or git:

npm install git+https://github.com/dhairya0907/react-native-compass.git
npm install git+https://github.com/sriraman/react-native-shared-preferences.git

Using React Native >= 0.60

  Linking the package manually is not required anymore with Autolinking.

 

Usage

Import the library

import { CompassModule, getDegree } from "@dhairyasharma/react-native-compass";

Get compass

<CompassModule style={{height : "100%", width : "100%"}} handHeight={270} />

// Here handHeight is the height of the hand in dp
// And the style is the style of the compass
// Try to call CompassModule in the end of the design, see example

Get the compass Degree

getDegree().then(degree => {
  console.log(degree);
});

NOTE

For detail usage see example.


 

Acknowledgements

 

Author

Dhairya Sharma | @dhairya0907

 

License

The library is released under the MIT license. For more information see LICENSE.