Steps to reproduce
(1) Grab snippet and execute it
(2) Watch out device logs and monitor users location
Snippet code
var MapModule = require('ti.map');
var win = Ti.UI.createWindow({
fullscreen : false
});
var map = MapModule.createView({
userLocation : true,
userLocationButton : false,
mapType : MapModule.NORMAL_TYPE,
animate : true,
top : '30%',
region: {latitude: -33.87365, longitude: 151.20689, latitudeDelta: 0.1, longitudeDelta: 0.1 }, //Sydney
});
win.add(map);
win.open();
Ti.Geolocation.purpose = 'Location based services for App';
Ti.Geolocation.accuracy = Ti.Geolocation.ACCURACY_BEST;
Ti.Geolocation.preferredProvider = Ti.Geolocation.PROVIDER_GPS;
Ti.Geolocation.distanceFilter = 10;
//it will be fired just once
Titanium.Geolocation.getCurrentPosition(function(e) {
var longitude = e.coords.longitude;
var latitude = e.coords.latitude;
Ti.API.info( 'long:' + longitude + ' lat: ' + latitude);
//force the map to show users current location
map.region = {latitude: latitude, longitude: longitude, latitudeDelta: 0.1, longitudeDelta: 0.1 };
});
Results are as follows (logs attached):
1. HTC Incredible 2.3.4 - Users location is shown on the map.
2. Samsung Galaxy Note 2.3.6 - Users location is shown on the map.
2. Droid Razr 2.3.5 - Users location is shown on the map.
4. Samsung Galaxy Note 4.0.0 - USers location is NOT shown on the map.
We tested with Galaxy Note (4.1.1) and ran into the same problem. It turned out location services wasn't enabled on our phone. Once we enabled it (Settings -> Location Services -> Google location services), current location seemed to work fine. Closing as invalid.
Closing ticket as invalid.