Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/JarleySoft/CompassPlugin
Compass Plugin for Xamarin and Windows
https://github.com/JarleySoft/CompassPlugin
android ios plugins-for-xamarin uwp xamarin
Last synced: 3 months ago
JSON representation
Compass Plugin for Xamarin and Windows
- Host: GitHub
- URL: https://github.com/JarleySoft/CompassPlugin
- Owner: JarleySoft
- License: mit
- Created: 2014-12-30T20:10:25.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2018-04-05T06:49:00.000Z (over 6 years ago)
- Last Synced: 2024-07-05T21:48:45.710Z (4 months ago)
- Topics: android, ios, plugins-for-xamarin, uwp, xamarin
- Language: C#
- Homepage: http://xamarin.com/plugins
- Size: 965 KB
- Stars: 21
- Watchers: 4
- Forks: 11
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-xamarin - Compass ★19 - Provides and simple way to access the compass on Windows Phone, iOS and Android from you Xamarin.Forms projects. (Xamarin.Forms)
README
## Compass Plugin
Provides and simple way to access the compass on iOS, Android, and Windows. Returns 0-360 degrees### Setup
* Available on NuGet: https://www.nuget.org/packages/Plugin.Compass
* Install into your PCL project and Client projects.**Platform Support**
|Platform|Version|
| ------------------- | :-----------: |
|Xamarin.iOS|iOS 7+|
|Xamarin.Android|API 14+|
|Windows 10 UWP|10+|### API Usage
**IsSupported**
```csharp
///
/// Determine if Compass is available.
///
bool IsSupported { get; }
```**Start**
```csharp
///
/// Plugin will begin firing CompassChanged events as they are available
///
void Start();
```**Stop**
```csharp
///
/// Plugin will stop firing events
///
void Stop();
```**DirectionChanged Event**
```csharp
///
/// Event fires when updates are available
///
event EventHandler CompassChanged;
```**CompassChangedEventArgs**
```csharp
///
/// EventArgs included when CompassChanged Event fires (Returns 0-360 degrees)
///
double Heading { get; }
```### Usage
```csharp
CrossCompass.Current.CompassChanged += (s, e) =>
{
Debug.WriteLine("*** Compass Heading = {0}", e.Heading);
label.Text = $"Heading = {e.Heading}";
};CrossCompass.Current.Start();
```#### Contributors
* [Carl Barton](https://github.com/JarleySoft)
* [James Montemagno](https://github.com/jamesmontemagno)Thanks!
#### License
Licensed under MIT see License file