nightcodezero / KatSini

Cordova Google Play Location

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KatSini - Cordova plugin location for android

Simple plugin to get current user location using Google Play Service.

Using

Create a new Cordova Project

$ cordova create katsini com.location.katsini katsini

Install the plugin

$ cd hello
$ cordova plugin add https://github.com/muhdfauzan93/KatSini.git

Edit www/js/index.js and add the following code inside onDeviceReady

var success = function(location) {
  alert(
    'Latitude: ' + location.latitude + '||' + 'Longitude:' + location.longitude
  );
};

var failure = function(message) {
  if (message === 'Access Denied') {
    alert('Please allow Google Play Service Location');
  } else {
    alert('Error calling KatSini Plugin');
  }
};

// Start location service
katsini.currentLocation(success, failure);

// Stop location service
katsini.stopLocation(success, failure);

Install iOS or Android platform

cordova platform add ios
cordova platform add android

Run the code

cordova run

More Info

For more information on setting up Cordova see the documentation

About

Cordova Google Play Location

License:Other


Languages

Language:Java 88.8%Language:Objective-C 4.5%Language:C# 3.8%Language:JavaScript 2.9%