|
@@ -21,6 +21,7 @@ |
|
@@ -21,6 +21,7 @@ |
21
|
BOOL delegateHasBeforeMapZoomByFactor;
|
21
|
BOOL delegateHasBeforeMapZoomByFactor;
|
22
|
BOOL delegateHasAfterMapZoomByFactor;
|
22
|
BOOL delegateHasAfterMapZoomByFactor;
|
23
|
BOOL delegateHasDoubleTapOnMap;
|
23
|
BOOL delegateHasDoubleTapOnMap;
|
|
|
24
|
+ BOOL delegateHasTapOnMarker;
|
24
|
@end
|
25
|
@end
|
25
|
|
26
|
|
26
|
@implementation RMMapView
|
27
|
@implementation RMMapView
|
|
@@ -94,9 +95,7 @@ |
|
@@ -94,9 +95,7 @@ |
94
|
delegateHasAfterMapZoomByFactor = [(NSObject*) delegate respondsToSelector: @selector(afterMapZoom: byFactor: near:)];
|
95
|
delegateHasAfterMapZoomByFactor = [(NSObject*) delegate respondsToSelector: @selector(afterMapZoom: byFactor: near:)];
|
95
|
|
96
|
|
96
|
delegateHasDoubleTapOnMap = [(NSObject*) delegate respondsToSelector: @selector(doubleTapOnMap:)];
|
97
|
delegateHasDoubleTapOnMap = [(NSObject*) delegate respondsToSelector: @selector(doubleTapOnMap:)];
|
97
|
-
|
|
|
98
|
- NSLog(@"%d %d %d %d %d", delegateHasBeforeMapMove, delegateHasAfterMapMove, delegateHasBeforeMapZoomByFactor, delegateHasAfterMapZoomByFactor, delegateHasDoubleTapOnMap);
|
|
|
99
|
-
|
98
|
+ delegateHasTapOnMarker = [(NSObject*) delegate respondsToSelector:@selector(tapOnMarker:onMap:)];
|
100
|
}
|
99
|
}
|
101
|
|
100
|
|
102
|
- (id<RMMapViewDelegate>) delegate
|
101
|
- (id<RMMapViewDelegate>) delegate
|
|
@@ -247,8 +246,7 @@ |
|
@@ -247,8 +246,7 @@ |
247
|
// When factoring, beware these two instructions need to happen in this order.
|
246
|
// When factoring, beware these two instructions need to happen in this order.
|
248
|
[RMMapContents setPerformExpensiveOperations:YES];
|
247
|
[RMMapContents setPerformExpensiveOperations:YES];
|
249
|
}
|
248
|
}
|
250
|
- //*************************************************************************************
|
|
|
251
|
- //Double-tap detection (currently used for debugging pixelToLatLng() method)
|
249
|
+
|
252
|
if (touch.tapCount == 2)
|
250
|
if (touch.tapCount == 2)
|
253
|
{
|
251
|
{
|
254
|
if (delegateHasDoubleTapOnMap) {
|
252
|
if (delegateHasDoubleTapOnMap) {
|
|
@@ -258,7 +256,14 @@ |
|
@@ -258,7 +256,14 @@ |
258
|
// [contents zoomInToNextNativeZoom];
|
256
|
// [contents zoomInToNextNativeZoom];
|
259
|
}
|
257
|
}
|
260
|
}
|
258
|
}
|
261
|
- //***************************************************************************************
|
259
|
+
|
|
|
260
|
+ if (touch.tapCount == 1)
|
|
|
261
|
+ {
|
|
|
262
|
+ CALayer* hit = [contents.overlay hitTest:[touch locationInView:self]];
|
|
|
263
|
+ if (hit != nil && [hit isMemberOfClass: [RMMarker class]]) {
|
|
|
264
|
+ if (delegateHasTapOnMarker) [delegate tapOnMarker: (RMMarker*) hit onMap: self];
|
|
|
265
|
+ }
|
|
|
266
|
+ }
|
262
|
|
267
|
|
263
|
// [contents recalculateImageSet];
|
268
|
// [contents recalculateImageSet];
|
264
|
}
|
269
|
}
|