Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TiMOB-18510] iOS - Fixed map draggable map pins #82

Merged
merged 2 commits into from
Mar 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions ios/Classes/TiMapView.m
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,11 @@ - (void)mapViewDidFailLoadingMap:(MKMapView *)mapView withError:(NSError *)error
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)annotationView didChangeDragState:(MKAnnotationViewDragState)newState fromOldState:(MKAnnotationViewDragState)oldState
{
[self firePinChangeDragState:annotationView newState:newState fromOldState:oldState];
if (newState == MKAnnotationViewDragStateStarting) {
[annotationView setDragState: MKAnnotationViewDragStateDragging];
} else if (newState == MKAnnotationViewDragStateEnding || newState == MKAnnotationViewDragStateCanceling) {
[annotationView setDragState: MKAnnotationViewDragStateNone];
}
}

- (void)firePinChangeDragState:(MKAnnotationView *) pinview newState:(MKAnnotationViewDragState)newState fromOldState:(MKAnnotationViewDragState)oldState
Expand Down Expand Up @@ -790,10 +795,7 @@ - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnno
annView.rightCalloutAccessoryView = right;
}

BOOL draggable = [TiUtils boolValue: [ann valueForUndefinedKey:@"draggable"]];
if (draggable && [[MKAnnotationView class] instancesRespondToSelector:NSSelectorFromString(@"isDraggable")])
[annView performSelector:NSSelectorFromString(@"setDraggable:") withObject:[NSNumber numberWithBool:YES]];

[annView setDraggable: [TiUtils boolValue: [ann valueForUndefinedKey:@"draggable"]]];
annView.userInteractionEnabled = YES;
annView.tag = [ann tag];
return annView;
Expand Down
2 changes: 2 additions & 0 deletions ios/documentation/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Change Log
<pre>
v2.2.1 Fixed map draggable map pins [TIMOB-18510]

v2.2.0 Updated to build for 64-bit [TIMOB-17928]
Adding architectures to manifest [TIMOB-18065]

Expand Down
4 changes: 2 additions & 2 deletions ios/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 2.2.0
version: 2.2.1
apiversion: 2
architectures: armv7 arm64 i386 x86_64
description: External version of Map module
author: Jeff Haynie & Jon Alter
author: Jeff Haynie, Jon Alter, & Pedro Enrique
license: Apache Public License v2
copyright: Copyright (c) 2013 by Appcelerator, Inc.

Expand Down