@dhairyasharma/react-native-compass
v1.0.1
Published
Native android compass library for react-native
Downloads
2
Maintainers
Readme
@dhairyasharma/react-native-compass
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 [email protected]
or npm:
npm install --save @dhairyasharma/react-native-compass
npm install --save [email protected]
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
- Module template by react-native-module-template
Author
Dhairya Sharma | @dhairya0907
License
The library is released under the MIT license. For more information see LICENSE
.