Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1320] MapView crashing the application when opened on a second window

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2014-10-28T08:36:12.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsandroid
ReporterRamesh RAMAMURTHY
AssigneeMauro Parra-Miranda
Created2014-08-17T21:47:30.000+0000
Updated2016-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();

Comments

  1. Mostafizur Rahman 2014-08-19

    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
    var 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();
    Map Window
    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;
    *TESTING RESULTS:* Its working as we expected. Its not a bug.
  2. Ramesh RAMAMURTHY 2014-09-03

    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.

JSON Source