researchstudio-sat / webofneeds

Finding people to cooperate with. Protocol, not platform. Decentralized. Linked Data. Open Source.
http://researchstudio-sat.github.io/webofneeds/
Apache License 2.0
63 stars 20 forks source link

Google maps locating feature doesn't work #6

Closed sbyim closed 9 years ago

sbyim commented 10 years ago

Google maps locating feature doesn't work when creating needs

sbyim commented 10 years ago

angular.module('won.owner').factory('mapService', function () { var currentGeolocation = new google.maps.LatLng(35.784, -78.670);

return {

    getInitialLocation:function(){
        //var initialLocation;
        if(navigator.geolocation){
            navigator.geolocation.getCurrentPosition(function(position) {
                currentGeolocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);
                var temp =new google.maps.LatLng(position.coords.latitude,position.coords.longitude);
                return currentGeolocation;
            },function(){
                this.handleNoGeolocation();
            },{timeout:10000})
        }
        else {
            alert('gelocation not supported');
        }
    },
    handleNoGeolocation:function(){
        return currentGeolocation;
    },
    getGeolocation:function(){
        this.getInitialLocation();
        return currentGeolocation;
    }
}

});

sbyim commented 10 years ago

location service only works when page is reloaded..

sbyim commented 10 years ago

maybe this could help.. https://angular-ui.github.io/angular-google-maps/#!/use

sbyim commented 9 years ago

not relevant anymore.