Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17657] iOS8: Map in a webview does not load

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionCannot Reproduce
Resolution Date2014-09-15T20:42:55.000+0000
Affected Version/sRelease 3.4.0
Fix Version/sn/a
ComponentsiOS
Labelsios8, qe-3.4.0
ReporterSatyam Sekhri
AssigneeIngo Muschenetz
Created2014-09-09T10:01:56.000+0000
Updated2016-09-06T16:02:28.000+0000

Description

A Map inside a webview does not load on iOS 8 device. The issue does not occur on iOS 7. Steps to Reproduce: 1. Run the app with the code below Actual Result: The Map contents do not load. It shows the zoom in and zoom out button but the map remains blank. Also it does not prompt for permissions to use location services, as it does on iOS 7. Expected Result: The map on the webview should load successfully
var _window = Ti.UI.createWindow({
	top : '20dp',
	width : Ti.UI.FILL,
	height : Ti.UI.FILL
});

_window.add(Ti.UI.createWebView({
	width : Ti.UI.FILL,
	height : Ti.UI.FILL,
	url : 'http://leafletjs.com/examples/mobile-example.html'
	//url: 'https://maps.google.com'
}));
_window.open();

Attachments

FileDateSize
Screen Shot 2014-09-15 at 1.30.42 PM.png2014-09-15T20:34:55.000+0000622313

Comments

  1. Eric Merriman 2014-09-10

    [~ssekhri] I tried changing the url to the commented google maps. That works, and I got prompted for the permission with iOS 7 simulator. I tried hitting the leaflet.js map on my iPhone (iOS 7) with safari and it worked there. Perhaps there is something unique about their map implementation that is not working with our web view. I'll try the iOS 8 simulator to reproduce.
  2. Olga Romero 2014-09-15

    Tested the above code with ti.map 2.0.3 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 Packaged the app for mobile web. Map loaded in device browser successfully after asking for permission. (screenshot)
  3. Ingo Muschenetz 2014-09-15

    Marking as cannot reproduce based on latest tests.
  4. Christoph Eck 2016-09-06

    *Hint* Does only work if you request for permission before you open the webview. I.e.
       var _window = Ti.UI.createWindow({
           width : Ti.UI.FILL,
           height : Ti.UI.FILL,
           top : '20dp',
       });
       _window.add(Ti.UI.createWebView({
           width : Ti.UI.FILL,
           height : Ti.UI.FILL,
           url : 'https://maps.google.com'
       }));
       // in tiapp.xml set the correction permissions for iOS and Android too
       Ti.Geolocation.requestLocationPermissions(Ti.Geolocation.AUTHORIZATION_ALWAYS, function(e) {
           if (e.success) {
               _window.open();
               return;
           } else {
               Ti.API.info('denied');
               return;
           }
       });
       

JSON Source