npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-lostlocationprovider

v0.0.4

Published

A simple React Native Android module that wraps Mapzen's LOST [(Location Open Source Tracker)](https://github.com/mapzen/LOST) as an alternative to Google's FusedLocationProviderAPI.

Downloads

2

Readme

#React-Native-LOSTLocationProvider A simple React Native Android module that wraps Mapzen's LOST (https://github.com/mapzen/LOST) as an alternative to Google's FusedLocationProviderAPI.

Current Version: 0.0.4

##Installation (Gradle)

  • Install module

npm i --save react-native-lostlocationprovider

  • android/settings.gradle
...
include :react-native-lostlocationprovider
project(':react-native-lostlocationprovider').projectDir = new File(settingsDir, '../node_modules/react-native-lostlocationprovider')
  • android/app/build.gradle
dependencies {
  ...
  compile project(':react-native-lostlocationprovider')
}
  • Register module
import io.whereat.lostlocationprovider.LOSTLocationPackage;
public class MainActivity extends ReactActivity {
  ...
  @Override
  protected List<ReactPackage> getPackages() {
    return Arrays.asList(
      ...,
      new LOSTLocationPackage());
    }

  }
  ...
}
  • Import into React Native
import {NativeModules} from 'react-native';
const location = NativeModules.LOSTLocationProvider;

##Usage ####Constants (Mapped from LOST LocationRequest Constants)

  • BALANCED_POWER_ACCURACY
  • HIGH_ACCURACY
  • LOW_POWER
  • NO_POWER

####Methods

  • startLocationPolling(Integer interval, Float distance, int priority)
    • Request location updates from LOST
    • Parameters:
      • interval - Polling frequency in milliseconds
      • distance - Minimum distance for update in meters
      • priority - Poling priority mode (Should use provided constants)
    • NOTE: This method lazy loads the location listener. StartLocationPolling must be called before other methods are called.
  • stopLocationPolling()
    • Stop location updates from LOST
  • mockLocation(Float latitude, Float longitude)
    • Immediately send a mock location to the location listener.
    • NOTE: This method requires a location listener to have been loaded for it to work. Call startLocationPolling() first.
    • NOTE: This method leaves LOST in mock mode. Calling startLocationPolling() after this without turning off mock mode will not work.
  • setMockMode(Boolean value)
    • Set LOST mock mode. When mock mode is off, location polling will work as expected, using cell networks, wifi, and gps to resolve device location. When mock mode is on, polling will stop and the location listener will immediately broadcast any locations sent through mockLocation().

####Events ######location_changed

  • parameters:

    • longitude
    • latitude
    • altitude
    • bearing
    • speed
    • accuracy
    • time
    • hasAccuracy
    • hasAltitude
    • hasBearing
    • hasSpeed
  • example:

    DeviceEventEmitter.addListener('location_changed', this.myEventHandler);