2016-09-22 18:03:05 +02:00
|
|
|
/**
|
|
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* This source code is licensed under the BSD-style license found in the
|
|
|
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#import "RCTMapboxAnnotationManager.h"
|
|
|
|
|
|
2017-02-07 03:06:45 -06:00
|
|
|
#import <React/RCTUIManager.h>
|
|
|
|
|
#import <React/RCTConvert+CoreLocation.h>
|
|
|
|
|
#import <React/UIView+React.h>
|
2016-09-22 18:03:05 +02:00
|
|
|
#import "RCTMapboxAnnotation.h"
|
|
|
|
|
|
|
|
|
|
@interface RCTMapboxAnnotationManager () <MGLMapViewDelegate>
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
@implementation RCTMapboxAnnotationManager
|
|
|
|
|
|
|
|
|
|
RCT_EXPORT_MODULE()
|
|
|
|
|
|
|
|
|
|
- (UIView *)view
|
|
|
|
|
{
|
2016-09-22 20:11:50 +02:00
|
|
|
RCTMapboxAnnotation *marker = [[RCTMapboxAnnotation alloc] init];
|
2016-09-22 18:03:05 +02:00
|
|
|
// UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(_handleTap:)];
|
|
|
|
|
// // setting this to NO allows the parent MapView to continue receiving marker selection events
|
|
|
|
|
// tapGestureRecognizer.cancelsTouchesInView = NO;
|
|
|
|
|
// [marker addGestureRecognizer:tapGestureRecognizer];
|
|
|
|
|
marker.bridge = self.bridge;
|
|
|
|
|
return marker;
|
|
|
|
|
}
|
|
|
|
|
|
2016-09-27 12:16:55 +02:00
|
|
|
RCT_EXPORT_VIEW_PROPERTY(id, NSString)
|
2016-09-22 18:03:05 +02:00
|
|
|
RCT_EXPORT_VIEW_PROPERTY(title, NSString)
|
|
|
|
|
RCT_EXPORT_VIEW_PROPERTY(subtitle, NSString)
|
|
|
|
|
RCT_EXPORT_VIEW_PROPERTY(coordinate, CLLocationCoordinate2D)
|
|
|
|
|
|
|
|
|
|
@end
|