Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-4453

Android - Crash when clicked on a mapview annotation without pincolor property

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Duplicate
    • Affects Version/s: Release 1.7.0, Release 1.6.2, Release 1.7.1, Release 1.7.3
    • Fix Version/s: None
    • Component/s: Android
    • Environment:

      Android Emulator 2.2
      Ti 1.6.3 1.7.0 1.7.1

      Description

      The problem

      If the annotation is clicked but it does not have a pincolor, the app crashes when clicked on it

      Solution

      Add a pincolor manually to the annotation

      Code Sample

      var W = {};
      W.MapView = function(){
      	var win = Ti.UI.createWindow({
      		tabBarHidden:true,
      		fullscreen:false
      	});
      	var data = [];
      	data.push(
      		Ti.Map.createAnnotation({
      			latitude:40.892651,
      			longitude:-74.001920,
      			title:'title here',
      			subtitle:'sub title here'
      		//	, pincolor:Titanium.Map.ANNOTATION_GREEN
      		})
      	);
      	var map = Ti.Map.createView({
      		region:{
      			latitude:40.892651,
      			longitude:-74.001920,
      			latitudeDelta:0.1,
      			longitudeDelta:0.1
      		},
      		annotations:data
      	});
       
      	win.addEventListener('open', function(){
      		win.add(map);
      	});
      	return win;
      }
       
      W.MapView().open();
      

      To reproduce

      1. Run the code provided in app.js as is. Click on the pin. It will crash.
      2. Uncomment line 14 to give it a color. It will not crash.

      Note that when pincolor is set to a supported color, as per the list in TiMapView.java, the app does not crash and the color renders correctly.

      When pincolor is set to a non-supported color, such as "mycolor", the app also does not crash and the rendered color defaults to yellow.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                joshroesslein Josh Roesslein
                Reporter:
                penrique Pedro Enrique (Inactive)
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-3813
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code