您当前的位置: Android API 概述
基础地图

初始化地图界面

1.初始化SDK ,必须先执行SDK的初始化得到授权后,才能加载地图

/**
 * 初始SDK
 */
public void initSDK() {
    HYMap.getInstance().initMap(DemoSDKApplicaiton.getInstance(), "1v3s0684t30F93z20n86615n", "com.ios_demo.www");
}
									

2.在Activity的Layout中添加 ihooyah.map.view.HYMapView

<ihooyah.map.view.HYMapView
android:id="@+id/content_mapview"
android:layout_width="match_parent"
android:layout_height="match_parent"
>"/ihooyah.map.view.HYMapView>
									

3.创建HYTDTMapView

CGFloat origin_y = 64;
self.mapView = [[HYTDTMapView alloc] initWithFrame:CGRectMake(0, origin_y, self.view.bounds.size.width, self.view.bounds.size.height-origin_y)];
self.mapView.delegate = self;
//显示当前位置
self.mapView.showUserLocation = YES;
//当前位置的图标(如果要显示当前位置,此项必须设置)
self.mapView.userLocationImage = [UIImage imageNamed:@"user_location"];
[self.view addSubview:self.mapView];
									

编译,运行,效果如下图所示:

ios-jicheng.jpg