此处,初始化后,Maps React Native NMAMapView为零

时间:2020-04-23 07:14:55

标签: heremaps-ios-sdk

我正在开发一个包含Here Map集成的react native应用。 iOS目标C部分导致一些问题。导航正常(语音提示指导)。但是,地图视图不起作用。调用后NMAMapView对象为nil

mapView = [[NMAMapView alloc] init];

知道我在这里缺少什么吗?视图加载但不显示地图。没有错误消息或控制台输出,例如表示此处的地图身份验证存在问题。

我的UIComponent类

 // .h
 #import <MapKit/MapKit.h>
 #import <NMAKit/NMAMapScheme.h>
 #import <React/RCTComponent.h>
 @import NMAKit;

@interface RNTGuidanceView : UIView <NMANavigationManagerDelegate>

  @property (weak, nonatomic) IBOutlet NMAMapView *mapView;
  @property (strong, nonatomic) NMACoreRouter *router;
  @property (strong, nonatomic) NMAMapRoute *mapRoute;
//...

 // .m
  #import "React/RCTBridgeModule.h"
  #import "RNTGuidanceView.h"
  #import "React/UIView+React.h"
  @import NMAKit;

  @implementation RNTGuidanceView: UIView  {
  NMACoreRouter* router;
  NMAMapRoute* mapRoute;
  NMARoute* route;
  NMANavigationManager* navigationManager;
  NMAGeoBoundingBox* geoBoundingBox;
  NSInteger _eventCounter;
  NSInteger Gtopleft;

}

-(instancetype)initMap{
  if ((self = [super init])) {
    self.mapView = [[NMAMapView alloc] init];
//...
}

- (void)layoutSubviews
{
  [super layoutSubviews];
  _mapView.frame = self.bounds;
  [self addSubview:_mapView];
}

0 个答案:

没有答案