uni-map-tencent.md 1.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
## uni-map-tencent


### Gradle配置

首先需在项目根目录下的build.gradle增加仓库源

```
allprojects {
	repositories {
		jcenter()
		google()
        maven{
            url "https://oss.sonatype.org/content/groups/public"
        }
	}
}
```

项目应用下的build.gradle

```

android {
    defaultConfig {
        buildConfigField 'String', 'UTSEasyCom', '\"[{\\\"class\\\":\\\"uts.sdk.modules.DCloudUniMapTencent.UniMapTencentExtApiComponentsRegister\\\",\\\"method\\\":\\\"register\\\"}]\"'
    }
}

dependencies {
    implementation 'com.tencent.map:tencent-map-vector-sdk:5.6.0'
    implementation 'com.tencent.map:sdk-utilities:1.0.9'
    implementation 'com.tencent.map.geolocation:TencentLocationSdk-openplatform:7.5.4.3'
    implementation 'com.github.bumptech.glide:glide:4.16.0'
}
```

### 本地依赖库

|名称                   |备注|
|:--				    |:--|
|uni-map-tencent-release.aar   ||

将本地依赖库复制到app项目的libs下。


### AndroidManifest.xml配置

首先在腾讯位置服务官网申请api key, [文档](https://lbs.qq.com/mobile/androidMapSDK/developerGuide/getKey)

在AndroidManifest.xml中添加api key,如下:

```

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
	<application>
		<meta-data android:name="TencentMapSDK" android:value="申请的apikey" />
	</application>
</manifest>

```