Recently, I delved into using Ionic and incorporated Angular Leaflet Directive for geolocation display.
Everything seemed fine on desktop, but I hit a roadblock that I can't seem to overcome.
On mobile devices, the paths do not show up and the map remains gray.
https://i.sstatic.net/c8EHf.png
My Controller
.controller('ShowCtrl', function($scope, $stateParams, $ionicLoading, $timeout, $http, leafletData) {
$ionicLoading.show({template: 'Downloading...'});
$scope.center = {};
$scope.paths = {};
$scope.markers = {};
$scope.defaults = {};
$scope.map = {};
$http({
method: 'GET',
url: 'https://api.foursquare.com/v2/venues/'+$stateParams.id,
params: {
'client_id' : 'xxx',
'client_secret' : 'xxx',
'v' : '20130815',
}
}).then(function successCallback(data) {
$timeout(function () {
$scope.place = data.data.response.venue;
$scope.title = data.data.response.venue.name;
angular.extend($scope, {
center: {
lat: $scope.lat,
lng: $scope.long,
zoom: 12
},
paths: {
p1: {
color: '#ff612f',
weight: 5,
latlngs: [
{ lat: data.data.response.venue.location.lat, lng: data.data.response.venue.location.lng },
{ lat: $scope.lat, lng: $scope.long }
],
}
},
markers: {
destination: {
lat: data.data.response.venue.location.lat,
lng: data.data.response.venue.location.lng,
message: data.data.response.venue.name,
focus: true,
draggable: false,
icon: {
iconUrl: 'lib/leaflet/dist/images/marker-icon2.png',
}
},
mylocation: {
lat: $scope.lat,
lng: $scope.long,
icon: {
iconUrl: 'lib/leaflet/dist/images/marker-icon.png',
}
}
},
defaults: {
scrollWheelZoom: false,
zoomControl:false
}
});
$ionicLoading.hide();
}, 2000);
});
});
Map
<leaflet id="map" center="center" paths="paths" markers="markers" defaults="defaults"></leaflet>
Could someone lend me a hand with this issue?