Skip to content

Commit

Permalink
Merge pull request #124 from hansemannn/MOD-2131
Browse files Browse the repository at this point in the history
[MOD-2131] Fix dragging issues
  • Loading branch information
hansemannn committed Sep 2, 2015
2 parents b47a7c2 + 1ece276 commit 0f010ee
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
17 changes: 15 additions & 2 deletions apidoc/View.yml
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,21 @@ events:
- name: newState
summary: |
New drag state for the annotation, one of
[ANNOTATION_DRAG_STATE_START](Modules.Map.ANNOTATION_DRAG_STATE_START),
[ANNOTATION_DRAG_STATE_END](Modules.Map.ANNOTATION_DRAG_STATE_END).
[ANNOTATION_DRAG_STATE_NONE](Titanium.Map.ANNOTATION_DRAG_STATE_NONE),
[ANNOTATION_DRAG_STATE_START](Titanium.Map.ANNOTATION_DRAG_STATE_START),
[ANNOTATION_DRAG_STATE_DRAG](Titanium.Map.ANNOTATION_DRAG_STATE_DRAG),
[ANNOTATION_DRAG_STATE_CANCEL](Titanium.Map.ANNOTATION_DRAG_STATE_CANCEL) or
[ANNOTATION_DRAG_STATE_END](Titanium.Map.ANNOTATION_DRAG_STATE_END).
type: Number

- name: oldState
summary: |
Previous drag state for the annotation, one of
[ANNOTATION_DRAG_STATE_NONE](Titanium.Map.ANNOTATION_DRAG_STATE_NONE),
[ANNOTATION_DRAG_STATE_START](Titanium.Map.ANNOTATION_DRAG_STATE_START),
[ANNOTATION_DRAG_STATE_DRAG](Titanium.Map.ANNOTATION_DRAG_STATE_DRAG),
[ANNOTATION_DRAG_STATE_CANCEL](Titanium.Map.ANNOTATION_DRAG_STATE_CANCEL) or
[ANNOTATION_DRAG_STATE_END](Titanium.Map.ANNOTATION_DRAG_STATE_END).
type: Number
since: "3.1.0"

Expand Down
6 changes: 3 additions & 3 deletions ios/Classes/TiMapView.m
Original file line number Diff line number Diff line change
Expand Up @@ -823,11 +823,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) {
if (oldState == MKAnnotationViewDragStateStarting) {
[annotationView setDragState: MKAnnotationViewDragStateDragging];
} else if (newState == MKAnnotationViewDragStateEnding || newState == MKAnnotationViewDragStateCanceling) {
} else if (oldState == MKAnnotationViewDragStateEnding || newState == MKAnnotationViewDragStateCanceling) {
[annotationView setDragState: MKAnnotationViewDragStateNone];
}
}
}

- (void)firePinChangeDragState:(MKAnnotationView *) pinview newState:(MKAnnotationViewDragState)newState fromOldState:(MKAnnotationViewDragState)oldState
Expand Down
1 change: 1 addition & 0 deletions ios/documentation/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Change Log
<pre>
v2.4.1 Fixed an issue where pins have not been draggable anymore. [MOD-2131]
v2.4.0 iOS9: Upgrade map module to support bitcode. [TIMOB-19385]
v2.3.2 Fixed map crash with polygons when not setting mapType. [TIMOB-19102]
v2.3.1 Add drawing support. Includes polygons, polylines, and circles. [TIMOB-15410]
Expand Down
2 changes: 1 addition & 1 deletion ios/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 2.4.0
version: 2.4.1
apiversion: 2
architectures: armv7 arm64 i386 x86_64
description: External version of Map module
Expand Down

0 comments on commit 0f010ee

Please sign in to comment.