Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11912] MobileWeb: Unable to open map correctly second time

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-12-12T02:03:55.000+0000
Affected Version/sRelease 2.1.4
Fix Version/sRelease 3.1.0, 2012 Sprint 25, 2012 Sprint 25 JS
ComponentsMobileWeb
LabelsSupportTeam, qe-port
ReporterEduardo Gomez
AssigneeBryan Hughes
Created2012-11-30T20:21:49.000+0000
Updated2013-03-01T12:21:57.000+0000

Description

Issue

Using a mapView to display locations on map, when I open the map the first time it comes fine. But, when I try to access the map second time, the map does not come as expected, instead it comes as a cropped image.

Actual result

It covers only few portion of the screen (usually top-left). This image is draggable and can be moved on the screen. On zooming also, I am not able to get the exact position of my location pins.

Tested on

Browsers - Safari 6.0.2

Steps to reproduce

1. Click on Open 2. Go back 3. Repeat steps 1 & 2 - note a cropped map - as seen as image attached

Repro sequence

function RootWindow() {
	var win = Ti.UI.createWindow({
		backgroundColor : '#ccc'
	});

	var btn = Ti.UI.createButton({
		title : 'Open Map'
	});

	win.add(btn);

	btn.addEventListener('click', function() {
		var map = MapWindow();
		Nav.open(map)
	});

	return win;
}

function MapWindow() {
	var win = Ti.UI.createWindow({
		backgroundColor : 'white'
	});
	var map = Ti.Map.createView({
		region : {
			latitude : 10,
			longitude : 10
		},
		width : Ti.UI.FILL,
		height : Ti.UI.FILL
	});
	win.add(map);
	return win;
}

function NavigationGroup(_rootWindow) {
	var win = Ti.UI.createWindow();

	var nav = Titanium.UI.MobileWeb.createNavigationGroup({
		window : _rootWindow
	});

	win.add(nav);

	this.open = function(_win) {
		if (_win) {
			nav.open(_win, {
				animated : true
			});
		} else {
			win.open();
		}
	}
}

var Nav = new NavigationGroup(RootWindow());
Nav.open(); 

Attachments

FileDateSize
CroppedImageMapView1.png2012-11-30T20:21:49.000+0000818765
CroppedImageMapView2.png2012-11-30T20:21:49.000+000097202
Screen Shot 2012-12-10 at 5.07.10 PM.png2012-12-11T01:12:49.000+000040638

Comments

  1. Bryan Hughes 2012-12-11

    Pull Request: https://github.com/appcelerator/titanium_mobile/pull/3565
  2. Christian Sullivan 2012-12-11

  3. Chris Barber 2012-12-11

    This issue has not been fixed. The pull request has been reverted.
  4. Bryan Hughes 2012-12-11

    Pull Request: https://github.com/appcelerator/titanium_mobile/pull/3577
  5. Bryan Hughes 2012-12-17

    3_0_X PR: https://github.com/appcelerator/titanium_mobile/pull/3613
  6. Mauro Parra-Miranda 2013-01-08

    This is still happening with master. Shall I reopen?
  7. Chris Barber 2013-01-08

    @Mauro I just re-tested the test case provided in this ticket with master and it most certainly works in Chrome (Mac), Android 4.1 browser, and iOS 6. What browser are you seeing issues? Is the test case still the same?
  8. Olga Romero 2013-02-28

    It does work with: Titanium Studio, build: 3.0.2.201302191606 Titanium Studio, build: 3.0.2.GA Titanium Studio, build: 3.1.0.v20130227145654 Mac osx 10.8.2 Mountain Lion Chrome 24.0.13 Safari 6.0.2
  9. Shyam Bhadauria 2013-03-01

    Environment used for verification - Titanium SDK: 3.1.0.v20130226024607 Titanium SDK: 3.0.2.GA Titanium  Studio:3.0.2.201302141201 Mac osx 10.8 Mountain Lion Chrome 23.0.1271.101 Safari 6.0

JSON Source