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

Layar

v8.4.5

Published

PhoneGap/Cordova plugin for Layar to create Augmented Reality Apps

Downloads

1

Readme

Phonegap Layar Plugin

This is the official plugin for Layar in Apache Cordova/PhoneGap!

The Layar plugin for Apache Cordova allows you to use the JavaScript code in your Cordova application as you use in your web application to build an augmented reality app.

  • Supported on PhoneGap (Cordova) v3.3.0 and above.
  • This plugin is built with
    • iOS Layar SDK 8_4_4 20160315 b4e8c76
    • Android Layar SDK 8_4_4 20160229 1c600ef

Plugin Requirements and Set-Up

To use this plugin you will need to make sure you've registered with Layar and obtained your Layar Key and Layar Secret.

Limitations

Callbacks are not supported in the plugin. With the plugin you can launch a scan view or open a layar but cannot get javascript callbacks about what is going on. To implement callbacks please use the iOS and Android SDK natively.

Install Guide

This plugin requires Cordova CLI.

To install the plugin in your app, execute the following (replace variables where necessary):

# Create initial Cordova app
$ cordova create myApp
$ cd myApp/

$ cordova platform add ios (For iOS)
$ cordova platform add android (For Android)

# Add the plugin
$ cordova -d plugin add <path-to-phonegap-layar-plugin>

Its that simple!

Example App

We have provided an example app with the plugin. You can just copy the javascript file index.js and the corresponding html file index.htmland use it in your example app. Please dont forget to replace your key and secret in the index.js file.

Optionally you can also automatically generate an example and run it using dart. Just run 'dart test/run-sample.dart <ios/android>' from the command line.

API

Initialize

LayarPlugin.initialize(Layar Key, Layar Secret)

Initializes the layar plugin with a consumer key and secret

parameter (key) The oauth consumer key. Please contact layer support to obtain a license if you dont have one.

parameter (secret) The consumer secret. Please contact layer support to obtain a license if you dont have one.

return {Q.Promise} which you can use to implement success and failure callbacks.

For example:

LayarPlugin.initialize('asdasd;adiaspdiasdpa', 'asdasdasdasdadsasd'). then(Layar.success). fail(Layar.failure). done()

Open Scan View

LayarPlugin.openScanView()

Opens the scan view.

return {Q.Promise} which you can use to implement success and failure callbacks.

For example:

LayarPlugin.openScanView(). then(Layar.success). fail(Layar.failure). done()

Open URL

LayarPlugin.openURL(Layar URL)

Opens a layar view with a layar URL. Especially useful for opening geo layers

parameter (url) The URL to open. Example-> layar://carscen7g?param=value

return {Q.Promise} which you can use to implement success and failure callbacks.

For example:.

LayarPlugin.openURL('layar://carscen7g?param=value'). then(Layar.success). fail(Layar.failure). done()

Open Layar

LayarPlugin.openLayar(Layar Name)

Opens a layar view with a layar name. Especially useful for opening geo layers

parameter (layarname) The name of the layar to open. Example-> carscen7g

return {Q.Promise} which you can use to implement success and failure callbacks.

For example:

LayarPlugin.openLayar('carscen7g'). then(Layar.success). fail(Layar.failure). done()