0

I use library Angular Google Maps In documentation I have not found nothing about geolocation. I need use an optional plug-in for it? How to use geolocation in this library?

1
  • It doesn't look like that library has location services. You'll probably need a different library or maybe try using html5 geolocation. Commented May 20, 2015 at 15:55

1 Answer 1

0

I have used AngularJS-Geolocation. It is easy to use this library to obtenir the geolocation without security limits like HTTPS requirements. (If you are trying to use window.navigator.geolocation, it will require HTTPS for safty reason.)

This module is available as bower package, install it with this command:

bower install angularjs-geolocation

The usage like this

angular.module('barterApp',['geolocation'])
  .controller('geoCtrl', function ($scope,geolocation) {
    geolocation.getLocation().then(function(data){
      $scope.coords = {lat:data.coords.latitude, long:data.coords.longitude};
    });
});

Here is a live demo. Hope this could be helpful.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.