Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15613] iOS7: Ti.Map.View always asks for permission to use current location

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionDuplicate
Resolution Date2014-03-03T20:52:10.000+0000
Affected Version/sRelease 3.1.3
Fix Version/sn/a
ComponentsiOS
LabelsSupportTeam
ReporterFokke Zandbergen
AssigneeIngo Muschenetz
Created2013-10-24T10:24:33.000+0000
Updated2017-03-20T22:14:49.000+0000

Description

The following code will show a alert asking the user for permission to use his current location, regardless if userLocation is set to false or unset:
var win = Titanium.UI.createWindow({
    backgroundColor: '#fff'
});

win.add(Ti.Map.createView({
    mapType: Titanium.Map.STANDARD_TYPE,
    region: {
        latitude: 37.390749,
        longitude: -122.081651,
        latitudeDelta: 0.01,
        longitudeDelta: 0.01
    },
    userLocation: false
}));

win.open();

Cause

When the map is initialized in [TiMapView.m](https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/TiMapView.m#L63), showsUsersLocation is always set to YES. Instead, this should depend on whether userLocation was set.

Comments

  1. Fokke Zandbergen 2013-10-24

    The PR: https://github.com/appcelerator/titanium_mobile/pull/4843
  2. Dan Tamas 2013-10-24

    +1 on this :)
  3. Olga Romero 2014-03-29

    tested
       var map = require("ti.map");
       var win = Titanium.UI.createWindow({
           backgroundColor: '#fff'
       });
        
       win.add(map.createView({
           mapType: map.STANDARD_TYPE,
           region: {
               latitude: 37.390749,
               longitude: -122.081651,
               latitudeDelta: 0.01,
               longitudeDelta: 0.01
           },
           userLocation: false
       }));
        
       win.open();
       
    Mac osx 10.9.2 Mavericks Appcelerator Studio, build: 3.2.3.201403271839 Titanium SDK, build:3.2.3.v20140327115429 Node.JS Version: v0.10.13 NPM Version: 1.3.2 /usr/local/lib ├── acs@1.0.14 ├── alloy@1.3.1 ├── node-appc@0.2.0 ├── npm@1.3.2 ├── titanium@3.2.3-alpha2 └── titanium-code-processor@1.1.1-alpha Devices: iPad air iOS 7.1 iPhone 5S iOS 7.1
  4. Lee Morris 2017-03-20

    Closing ticket as duplicate.

JSON Source