[AC-1320] MapView crashing the application when opened on a second window
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | n/a |
| Status | Closed |
| Resolution | Cannot Reproduce |
| Resolution Date | 2014-10-28T08:36:12.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | Titanium SDK & CLI |
| Labels | android |
| Reporter | Ramesh RAMAMURTHY |
| Assignee | Mauro Parra-Miranda |
| Created | 2014-08-17T21:47:30.000+0000 |
| Updated | 2016-03-08T07:37:43.000+0000 |
Description
The app has one window that display a list of addresses. when we open a new window or replace the existing view with the a map view the application crashes with the message "unfortunately ......"
on the primary window should a list view and call this on click.
var Map = require('ti.map');
var win = Titanium.UI.createWindow();
var mountainView = Map.createAnnotation({
latitude:37.390749,
longitude:-122.081651,
title:"Appcelerator Headquarters",
subtitle:'Mountain View, CA',
pincolor:Map.ANNOTATION_RED,
myid:1 // Custom property to uniquely identify this annotation.
});
var mapview = Map.createView({
mapType: Map.NORMAL_TYPE,
region: {latitude:33.74511, longitude:-84.38993,
latitudeDelta:0.01, longitudeDelta:0.01},
animate:true,
regionFit:true,
userLocation:true,
annotations:[mountainView]
});
win.add(mapview);
// Handle click events on any annotations on this map.
mapview.addEventListener('click', function(evt) {
Ti.API.info("Annotation " + evt.title + " clicked, id: " + evt.annotation.myid);
});
win.open();
Hello, We have tested this issue with our sample code. When we have clicked a ListView item to open new window with MapView, its working as we expected . It’s not a Bug. *TESTING ENVIRONMENT:* Titanium SDK: 3.3.0.GA and 3.2.3.GA Titanium CLI: 3.3.0 OS X Version: 10.9.3 Android version: 4.3 Android API Level: 17 and 19 *STEPS TO REPRODUCE:* a) Create a simple project. b) Update this code in app.js c) Update your second window in “/ui/common/Map” d) Add Map module in tiapp.xml e) Run this with testing environment *TESTING CODE:* App.js
Map Windowvar win = Ti.UI.createWindow({ backgroundColor : '#000', navBarHidden : false, layout : 'vertical' }); var Template = { properties: {height: 40}, events: {click: function(e) { var item = e.section.getItemAt(e.itemIndex); var data = item.info.text; if(data=='Get Your Map') { //alert("you click Location services"); var Home = require('/ui/common/Home'); var homePage = new Home(); homePage.open(); } else if(data=="Map-2") { alert("you click Map-2"); } else if(data=="Map-3") { alert("you click Map-3"); } }}, childTemplates: [ { type: 'Ti.UI.Label', bindId: 'info', properties: { color: 'gray', font: { fontFamily:'Arial', fontSize: '20dp' }, left: '10dp', } } ]}; var section = Ti.UI.createListSection({}); var listView = Ti.UI.createListView({ templates: { 'temp': Template}, sections: [ section ] }); //Input data set here var data = [ {template:'temp', properties:{height:40},info:{text:'Get Your Map'}}, // Final Map showing {template:'temp', properties:{height:40},info:{text:'Map-2'}}, {template:'temp', properties:{height:40},info:{text:'Map-3'}}, ]; section.setItems(data); win.add(listView); win.open();*TESTING RESULTS:* Its working as we expected. Its not a bug.function Map() { var self = Ti.UI.createWindow({ layout : 'vertical', backgroundColor:'white' }); var Map = require('ti.map'); var mountainView = Map.createAnnotation({ latitude : 37.390749, longitude : -122.081651, title : "Appcelerator Headquarters", subtitle : 'Mountain View, CA', pincolor : Map.ANNOTATION_RED, myid : 1 // Custom property to uniquely identify this annotation. }); var mapview = Map.createView({ mapType : Map.NORMAL_TYPE, region : { latitude : 33.74511, longitude : -84.38993, latitudeDelta : 0.01, longitudeDelta : 0.01 }, animate : true, regionFit : true, userLocation : true, annotations : [mountainView] }); self.add(mapview); // Handle click events on any annotations on this map. mapview.addEventListener('click', function(evt) { Ti.API.info("Annotation " + evt.title + " clicked, id: " + evt.annotation.myid); }); return self; } module.exports = Map;Can we get an eta on when we will get this addressed? We are not able to show the maps to our users due to this issue.