Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17665] iOS8: userLocation is not displayed when using ti.map module

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-09-30T21:04:08.000+0000
Affected Version/sRelease 3.4.0
Fix Version/sRelease 3.4.0, Release 3.5.0
ComponentsiOS
Labelsios8, module_map, parity, qe-3.4.0, usability
ReporterOlga Romero
AssigneeJon Alter
Created2014-09-09T21:09:50.000+0000
Updated2014-11-21T20:28:52.000+0000

Description

To reproduce

1. Run the sample code, make sure to add ti.map module to tiapp.xml
var MapModule = require('ti.map');

var window = Ti.UI.createWindow({
	backgroundColor : 'white'
});

Titanium.UI.setBackgroundColor('#000');

window.title = 'Test';
window.backgroundColor = '#000';
window.exitOnClose = true;

window.add(MapModule.createView({
	userLocation : true
}));

window.open(); 

Actual result

No permission to use the user current location, no pin to display it.

Attachments

FileDateSize
ios7.png2014-09-09T21:09:50.000+0000444990
ios8.png2014-09-09T21:09:50.000+0000460235
ti.map-iphone-2.0.3.zip2014-09-13T19:42:42.000+0000727690

Comments

  1. Ingo Muschenetz 2014-09-12

    I think this is best for you to review.
  2. Ingo Muschenetz 2014-09-12

    [~vduggal] to act as reviewer.
  3. Pedro Enrique 2014-09-13

    PR for master: https://github.com/appcelerator-modules/ti.map/pull/48 PR for stable: https://github.com/appcelerator-modules/ti.map/pull/49
  4. Ingo Muschenetz 2014-09-13

    Since code is accepted, can we get a PR to merge this into the SDK?
  5. Pedro Enrique 2014-09-14

    PR for titanium_mobile with updated module.zip: master: https://github.com/appcelerator/titanium_mobile/pull/6074 3_4_X: https://github.com/appcelerator/titanium_mobile/pull/6080
  6. Jon Alter 2014-09-15

    Zip PR master: https://github.com/appcelerator-modules/ti.map/pull/50 Zip PR stable: https://github.com/appcelerator-modules/ti.map/pull/51
  7. Olga Romero 2014-09-15

    Open the tiapp.xml in the ios / plist / dict section add the below:
       <ios>
              <plist>
                  <dict>
                      <key>NSLocationAlwaysUsageDescription</key>
                      <string>Optional description here, can be empty</string>
                  </dict>
              </plist>
          </ios>
       
    Tested and verified the fix with Mac osx 10.9.4 Maverics Appcelerator Studio, build: 3.4.0.201409131030 Titanium SDK, build: 3.4.0.v20140915103316 acs@1.0.16 alloy 1.5.0-rc2 install@0.1.7 npm@1.4.23 sudo@1.0.3 titanium 3.4.0-rc3 titanium-code-processor@1.1.1 Xcode6 Device: iPhone 5S iOS8
  8. Travis Crist 2014-09-20

    Has this issue been tested with the NSLocationWhenInUseUsageDescription plist key? When I use that key the users location is still not showing up on the map. I get the prompt but the location is not shown on the map.
       <ios>
          <plist>
              <dict>
                  <key>NSLocationWhenInUseUsageDescription</key>
                  <string>Optional description here, can be empty</string>
              </dict>
          </plist>
       </ios>
       
  9. Travis Crist 2014-09-22

    Found a solution to this where when using NSLocationWhenInUseUsageDescription the users location would not show up on the map. Please see the commit: https://github.com/TravisCrist/ti.map/commit/e0e8066195d11cf0f13a4843f1d3ed61ebb84cd4 for the fix. It requires a change to the map module. I am unsure how to make a PR with just that commit.
  10. Marco Cota 2014-09-22

    Running some test based on Travis comment i have verified the issue with SDK 3.4.0.RC2 and Ti.Map module 2.0.3, when the NSLocationWhenInUseUsageDescription plist key is used the permission is correctly prompted and we can correctly retrieve the user location with Ti.Geolocation.getCurrentPosition but the map displayed in the app is not showing the blue marker for the user location, if we use the NSLocationAlwaysUsageDescription plist key the user location is correctly shown with the blue marker in the map tiSDK 3.4.0.RC2 tiMap 2.0.3 Xcode 6 iPhone 5s iOS 8

    Test Code

        var MapModule = require('ti.map');
         
        var window = Ti.UI.createWindow({
            backgroundColor : 'white'
        });
         
        var mapview = MapModule.createView({
            userLocation : true
        });
        window.add(mapview);
        
        setTimeout(function(){
        	Ti.Geolocation.getCurrentPosition( function(e) {
          if (!e.success || e.error) {
            alert('error ' + JSON.stringify(e.error));
            return;
          }
          alert(e.coords.latitude + ' ' + e.coords.longitude);
          var region = {
            latitude: e.coords.latitude,
            longitude: e.coords.longitude,
            animate:true,
            latitudeDelta:0.05,
            longitudeDelta:0.05
          };
          mapview.setLocation(region);
        });
        },5000);
        
        window.open(); 
        
    tiApp.xml
        <ios>
           <plist>
               <dict>
                       <key>NSLocationWhenInUseUsageDescription</key>
                       <string>Optional description here, can be empty</string>
               </dict>
            </plist>
        </ios>
        
  11. Jon Alter 2014-09-22

    master PR: https://github.com/appcelerator-modules/ti.map/pull/53 stable PR: https://github.com/appcelerator-modules/ti.map/pull/54 Thank you [~tcrist]!
  12. Jon Alter 2014-09-22

    TiSDK PRs 3_4_X PR: https://github.com/appcelerator/titanium_mobile/pull/6150 master PR: https://github.com/appcelerator/titanium_mobile/pull/6151
  13. Olga Romero 2014-09-23

    Tested and verified the userLocation is displayed when using ti.map module. The environment tested: Mac osx 10.9.5 Mavericks Appcelerator Studio, build: 3.4.0.201409161950 Titanium SDK, build: 3.4.0.v20140922135716 acs@1.0.16 alloy 1.5.0-rc2 install@0.1.7 npm@1.4.23 sudo@1.0.3 titanium 3.4.0-rc4 titanium-code-processor@1.1.1 Xcode6.0.1 (6A317) Devices: iPhone6 iOS 8 iPhone6+ iOS8 Closing as fixed.

JSON Source