@brunobm wrote:
Hi, I'm new to Ionic and Angular, using Creator exclusively. Any tips?
Even thought trying my best over here ... even with a lot of research.
But anyway!Wonder how can I pinpoint user location on map - Google Maps Component - through Angular?
I'm using the original code from a forum post: https://forum.ionicframework.com/t/how-to-user-ngcordova-with-ionic-creator/68619
Already updated the plugins, etc.It's positive for desktop browser but doesn't work in iOS... Can't understand why.
My main doubt remains, about pinpointing with a marker (circle) user location and update it over time.
Is there any other way to get around this?Can someone help over here? Thanks in advance!
function ($scope, $stateParams, $cordovaGeolocation, uiGmapGoogleMapApi) { $scope.MyLocation = { Lat:Infinity, Long:Infinity }; $scope.GetLocation = function() { var posOptions = {timeout: 10000, enableHighAccuracy: false}; $cordovaGeolocation .getCurrentPosition(posOptions) .then(function (position) { $scope.MyLocation.Lat = position.coords.latitude; $scope.MyLocation.Long = position.coords.longitude; }, function(err) { // error }); }; }
Posts: 1
Participants: 1