Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14694] Android: Maps V2 Map view instances overlap when placed in separate tabs

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionWon't Fix
Resolution Date2013-08-23T18:02:50.000+0000
Affected Version/sRelease 3.0.2, Release 3.1.0, Release 3.1.1
Fix Version/s2013 Sprint 17, 2013 Sprint 17 API
ComponentsAndroid
Labelsandroid, defect
ReporterAshish Nigam
AssigneeHieu Pham
Created2013-07-29T11:45:51.000+0000
Updated2017-03-22T21:09:09.000+0000

Description

Two different map instances are overlapping while using in two different tabs of a tabgroup. Steps to reproduce: 1: use the below sample code and copy paste it on a app.js file. 2: set the below property in the tiapp.xml file.
<android xmlns:android="http://schemas.android.com/apk/res/android">
        <manifest>
            <!-- Allows the API to download data from Google Map servers -->
            <uses-permission android:name="android.permission.INTERNET"/>
            <!-- Allows the API to cache data -->
            <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
            <!-- Use GPS for device location -->
            <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
            <!-- Use Wi-Fi or mobile connection for device location -->
            <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
            <!-- Allows the API to access Google web-based services -->
            <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
            <!-- Specify OpenGL ES 2.0 as a requirement -->
            <uses-feature android:glEsVersion="0x00020000" android:required="true"/>
            <!-- Replace com.domain.appid with your application ID -->
            <uses-permission android:name="cm.gl.apc.permission.MAPS_RECEIVE"/>
            <permission android:name="cm.gl.apc.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
            <application>
                <!-- Replace "PASTE YOUR GOOGLE MAPS API KEY HERE" with the Google API key you obtained -->
                <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="module key here"/>
            </application>
        </manifest>
    </android>
3: tes the module in device. 4: tab1 open by default and map rendered properly. 5: Switch to tab2, now you can see both the maps are displayed. **sample code (app.js)**
var MapModule = require('ti.map');
var tbGr = Ti.UI.createTabGroup();

var win1 = Ti.UI.createWindow({
	backgroundColor:"red",
	fullscreen:true
});

var win2 = Ti.UI.createWindow({
	backgroundColor:"yellow",
	fullscreen:true
});

var tb1 = Ti.UI.createTab({
	window:win1
});
var tb2 = Ti.UI.createTab({
	window:win2
});

tbGr.tabs = [tb1,tb2];


//var win = Ti.UI.createWindow({fullscreen: false});

var map1 = MapModule.createView({
	userLocation: true,
	mapType: MapModule.NORMAL_TYPE,
	animate: true,
	region: {latitude: -33.87365, longitude: 151.20689, latitudeDelta: 0.1, longitudeDelta: 0.1 }, //Sydney
	height: '50%',
	top: 0,
	left: 0,
	width: '80%'
});
var map2 = MapModule.createView({
	userLocation: true,
	mapType: MapModule.NORMAL_TYPE,
	animate: true,
	region: {latitude: -33.87365, longitude: 151.20689, latitudeDelta: 0.1, longitudeDelta: 0.1 }, //Sydney
	height: '50%',
	top: 0,
	right: 0,
	width: '80%'
});

win1.add(map1);
win2.add(map2);

tbGr.open();

Attachments

FileDateSize
map1_tab1.png2013-07-29T12:09:28.000+0000223044
map2_partial-Map1_tab2.png2013-07-29T12:09:28.000+0000229572

Comments

  1. Lee Morris 2017-03-22

    Closing ticket as "Won't Fix".

JSON Source