arcgis for android 安装包,Arcgis For Android 100.3.0 安装 SDK

Gradle

1. 添加 Esri's maven

在 Project 的 build.gradle 中添加

allprojects {

repositories {

google()

jcenter()

// Add the Esri public Bintray Maven repository

maven {

url 'https://esri.bintray.com/arcgis'

}

}

}

2. 添加依赖

在 Module 的 build.gradle 中添加

dependencies {

implementation 'com.esri.arcgisruntime:arcgis-android:100.3.0'

[...]

}

3.Java 8 的支持

android {

[...]

// Add below lines to set compatibility with Java 8 language features for an Android app module.

compileOptions {

sourceCompatibility JavaVersion.VERSION_1_8

targetCompatibility JavaVersion.VERSION_1_8

}

}

4.权限

Android API 版本在 23 之后,需要对危险权限添加运行时申请

除了一般的权限申请,需要在 AndroidManifest.xml 中添加 uses-feature element 申请 OpenGL 的权限.

使用GeoView 需要 OpenGL2.x 时

使用 ViewShed 或者 LineOfSight 需要 OpenGL3.x

5.添加 MapView

android:id="@+id/mapView"

android:layout_width="match_parent"

android:layout_height="match_parent" >

设置 MapView

mMapView = findViewById(R.id.mapView);

ArcGISMap map = new ArcGISMap(Basemap.Type.TOPOGRAPHIC, 34.056295, -117.195800, 16);

mMapView.setMap(map);

生命周期管理

@Override

protected void onPause(){

mMapView.pause();

super.onPause();

}

@Override

protected void onResume(){

super.onResume();

mMapView.resume();

}

@Override

protected void onDestroy() {

super.onDestroy();

mMapView.dispose();

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值