Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8494] iOS: MapView - in Ti 1.8.2 stale images are shown when adding new image annotations after removeAllAnnotations()

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-04-02T11:25:29.000+0000
Affected Version/sRelease 1.8.2
Fix Version/sRelease 3.0.2
ComponentsiOS
Labelsn/a
ReporterOlivier Morandi
AssigneeShameer Jan
Created2012-03-06T02:33:29.000+0000
Updated2017-03-21T21:32:56.000+0000

Description

Problem

Test scenario: 1. add an annotation with image on the map 2. remove all annotations 3. add a new annotation with different image Expected: * Different annotations should show different images Actual: * Only the image of the first annotation is shown each time an annotation is added Offending commit in TiMobile is: https://github.com/appcelerator/titanium_mobile/commit/cec61736bb171c6dd05463cf8d8b593dded07fa8

Test case

var win = Titanium.UI.createWindow({backgroundColor: 'white'});

var createAnnotationWithImage = function(image) {
	return Ti.Map.createAnnotation({
		latitude:37.390749,
		longitude:-122.081651,
		image: image
	});
};

var mapview = Titanium.Map.createView({
	region: {latitude:37.337681,longitude:-122.038193,animate:true,latitudeDelta:0.04, longitudeDelta:0.04}
});


function update_annotations() {
	mapview.removeAllAnnotations();
	mapview.annotations = [createAnnotationWithImage('image_1.png')];
}

mapview.annotations = [createAnnotationWithImage('image_0.png')];

setTimeout(update_annotations, 4000);

win.add(mapview);

win.open();

Attachments

FileDateSize
image_0.png2012-03-06T02:33:30.000+0000164
image_1.png2012-03-06T02:33:30.000+0000234

Comments

  1. Johnny Wong 2012-03-26

    Olivier -- Do you have a workaround for this one in the mean time? We're crushed by this one bug at the moment .... Thanks
  2. Olivier Morandi 2012-03-26

    A possible *temporary* workaround is to revert the commit I mentioned in the ticket in your Ti SDK. In other words you open the iphone/Classes/TiMapView.m file under your 1.8.2 sdk and replace line 649:
       annView = (MKAnnotationView*) [mapView dequeueReusableAnnotationViewWithIdentifier:identifier];
       
    with:
       if (![ann needsRefreshingWithSelection])	  	
       {
           annView = (MKAnnotationView*) [mapView dequeueReusableAnnotationViewWithIdentifier:identifier];	  	
       }
       
  3. Olivier Morandi 2012-03-26

    ok my code formatting didn't work, sorry
  4. Ivan Skugor 2012-03-26

    There is edit option here (on a contrary to QA :) ) and code syntax: { code }mycode{ code }. Just remove spaces from "code" tags. :)
  5. Olivier Morandi 2012-03-27

    Thx Ivan, I hate Jira ;-)
  6. Alfred Chiesa 2012-05-24

    I can confirm this is a bug.
  7. Shameer Jan 2013-04-02

    Issue does not reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 iOS iPhone Simulator: iOS SDK version: 6.0
  8. Lee Morris 2017-03-21

    Closing ticket as the issue cannot be reproduced.

JSON Source