uniapp+APP使用高德地图展示卫星地图
时间: 2023-12-23 20:06:10 浏览: 76
为了在uniapp+APP中展示高德地图卫星地图,需要按照以下步骤进行配置:
1.注册高德地图开放平台账号并添加应用,在应用中添加key。
2.生成自有证书(windows系统),并将生成的SHA1填写到申请高德key中。
3.在项目的manifest.json文件中配置高德地图key,具体步骤如下:
```json
{
"mp-weixin": {
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
}
},
"app-plus": {
"modules": {
"uni-geolocation": {
"provider": "amap",
"apiKey": "填写你的高德地图key"
},
"uni-amap": {
"apiKey": "填写你的高德地图key"
}
}
}
}
```
4.在app模块配置中勾选maps中的高德地图,并填入生成的key值。
5.在app权限配置中勾选与地图相关权限,可在源码视图直接添加。
6.在代码中使用uni-amap组件展示卫星地图,具体代码如下:
```html
<template>
<view>
<uni-amap :longitude="longitude" :latitude="latitude" :scale="scale" :markers="markers" :covers="covers" :polyline="polyline" :circles="circles" :controls="controls" :include-points="includePoints" :show-location="showLocation" :subkey="subkey" :layer-style="layerStyle" :rotate="rotate" :skew="skew" :enable-3D="enable3D" :show-compass="showCompass" :show-scale="showScale" :enable-overlooking="enableOverlooking" :enable-zoom="enableZoom" :enable-scroll="enableScroll" :enable-rotate="enableRotate" :enable-satellite="enableSatellite" :enable-traffic="enableTraffic" :setting="setting" :bindtap="bindtap" :bindupdated="bindupdated" :bindregionchange="bindregionchange" :bindpoitap="bindpoitap" :bindcallouttap="bindcallouttap" :bindcontroltap="bindcontroltap" :bindmarkertap="bindmarkertap" :bindlabeltap="bindlabeltap" :bindanchorpointtap="bindanchorpointtap" :bindcontroltap="bindcontroltap" :bindcallouttap="bindcallouttap" :bindupdated="bindupdated" :bindregionchange="bindregionchange" :bindpoitap="bindpoitap" :bindcallouttap="bindcallouttap" :bindcontroltap="bindcontroltap" :bindmarkertap="bindmarkertap" :bindlabeltap="bindlabeltap" :bindanchorpointtap="bindanchorpointtap" :bindcontroltap="bindcontroltap" :bindcallouttap="bindcallouttap" :bindupdated="bindupdated" :bindregionchange="bindregionchange" :bindpoitap="bindpoitap" :bindcallouttap="bindcallouttap" :bindcontroltap="bindcontroltap" :bindmarkertap="bindmarkertap" :bindlabeltap="bindlabeltap" :bindanchorpointtap="bindanchorpointtap" :bindcontroltap="bindcontroltap" :bindcallouttap="bindcallouttap" :bindupdated="bindupdated" :bindregionchange="bindregionchange" :bindpoitap="bindpoitap" :bindcallouttap="bindcallouttap" :bindcontroltap="bindcontroltap" :bindmarkertap="bindmarkertap" :bindlabeltap="bindlabeltap" :bindanchorpointtap="bindanchorpointtap" :bindcontroltap="bindcontroltap" :bindcallouttap="bindcallouttap" :bindupdated="bindupdated" :bindregionchange="bindregionchange" :bindpoitap="bindpoitap" :bindcallouttap="bindcallouttap" :bindcontroltap="bindcontroltap" :bindmarkertap="bindmarkertap" :bindlabeltap="bindlabeltap" :bindanchorpointtap="bindanchorpointtap" :bindcontroltap="bindcontroltap" :bindcallouttap="bindcallouttap" :bindupdated="bindupdated" :bindregionchange="bindregionchange" :bindpoitap="bindpoitap" :bindcallouttap="bindcallouttap" :bindcontroltap="bindcontroltap" :bindmarkertap="bindmarkertap" :bindlabeltap="bindlabeltap" :bindanchorpointtap="bindanchorpointtap" :bindcontroltap="bindcontroltap" :bindcallouttap="bindcallouttap" :bindupdated="bindupdated" :bindregionchange="bindregionchange" :bindpoitap="bindpoitap" :bindcallouttap="bindcallouttap" :bindcontroltap="bindcontroltap" :bindmarkertap="bindmarkertap" :bindlabeltap="bindlabeltap" :bindanchorpointtap="bindanchorpointtap" :bindcontroltap="bindcontroltap" :bindcallouttap="bindcallouttap" :bindupdated="bindupdated" :bindregionchange="bindregionchange" :bindpoitap="bindpoitap" :bindcallouttap="bindcallouttap" :bindcontroltap="bindcontroltap" :bindmarkertap="bindmarkertap" :bindlabeltap="bindlabeltap" :bindanchorpointtap="bindanchorpointtap" :bindcontroltap="bindcontroltap" :bindcallouttap="bindcallouttap" :bindupdated="bindupdated" :bindregionchange="bindregionchange" :bindpoitap="bindpoitap" :bindcallouttap="bindcallouttap" :bindcontroltap="bindcontroltap" :bindmarkertap="bindmarkertap" :bindlabeltap="bindlabeltap" :bindanchorpointtap="bindanchorpointtap" :bindcontroltap="bindcontroltap" :bindcallouttap="bindcallouttap" :bindupdated="bindupdated" :bindregionchange="bindregionchange" :bindpoitap="bindpoitap" :bindcallouttap="bindcallouttap" :bindcontroltap="bindcontroltap" :bindmarkertap="bindmarkertap" :bindlabeltap="bindlabeltap" :bindanchorpointtap="bindanchorpointtap" :bindcontroltap="bindcontroltap" :bindcallouttap="bindcallouttap" :bindupdated="bindupdated" :bindregionchange="bindregionchange" :bindpoitap="bindpoitap" :bindcallouttap="bindcallouttap" :bindcontroltap="bindcontroltap" :bindmarkertap="bindmarkertap" :bindlabeltap="bindlabeltap" :bindanchorpointtap="bindanchorpointtap" :bindcontroltap="bindcontroltap" :bindcallouttap="bindcallouttap" :bindupdated="bindupdated" :bindregionchange="bindregionchange" :bindpoitap="bindpoitap" :bindcallouttap="bindcallouttap" :bindcontroltap="bindcontroltap" :bindmarkertap="bindmarkertap" :bindlabeltap="bindlabeltap" :bindanchorpointtap="bindanchorpointtap" :bindcontroltap="bindcontroltap" :bindcallouttap="bindcallouttap" :bindupdated="bindupdated" :bindregionchange="bindregionchange" :bindpoitap="bindpoitap" :bindcallouttap="bindcallouttap" :bindcontroltap="bindcontroltap" :bindmarkertap="bindmarkertap" :bindlabeltap="bindlabeltap" :bindanchorpointtap="bindanchorpointtap" :bindcontroltap="bindcontroltap" :bindcallouttap="bindcallouttap" :bindupdated="bindupdated" :bindregionchange="bindregionchange" :bindpoitap="bindpoitap" :bindcallouttap="bindcallouttap" :bindcontroltap="bindcontroltap" :bindmarkertap="bindmarkertap" :bindlabeltap="bindlabeltap" :bindanchorpointtap="bindanchorpointtap" :bindcontroltap="bindcontroltap" :bindcallouttap="bindcallouttap" :bindupdated="bindupdated" :bindregionchange="bindregionchange" :bindpoitap="bindpoitap" :bindcallouttap="bindcallouttap" :bindcontroltap="bindcontroltap" :bindmarkertap="bindmarkertap" :bindlabeltap="bindlabeltap" :bindanchorpointtap="bindanchorpointtap" :bindcontroltap="bindcontroltap" :bindcallouttap="bindcallouttap" :bindupdated="bindupdated" :bindregionchange="bindregionchange" :bindpoitap="bindpoitap" :bindcallouttap="bindcallouttap" :bindcontroltap="bindcontroltap" :bindmarkertap="bindmarkertap" :bindlabeltap="bindlabeltap" :bindanchorpointtap="bindanchorpointtap" :bindcontroltap="bindcontroltap" :bindcallouttap="bindcallouttap" :bindupdated="bindupdated" :bindregionchange="bindregionchange" :bindpoitap="bindpoitap" :bindcallouttap="bindcallouttap" :bindcontroltap="bindcontroltap" :bindmarkertap="bindmarkertap" :bindlabeltap="bindlabeltap" :bindanchorpointtap="bindanchorpointtap" :bindcontroltap="bindcontroltap" :bindcallouttap="bindcallouttap" :bindupdated="bindupdated" :bindregionchange="bindregionchange" :bindpoitap="bindpoitap" :bindcallouttap="bindcallouttap" :bindcontroltap="bindcontroltap" :bindmarkertap="bindmarkertap" :bindlabeltap="bindlabeltap" :bindanchorpointtap="bindanchorpointtap" :bindcontroltap="bindcontroltap" :bindcallouttap="bindcallouttap" :bindupdated="bindupdated" :bindregionchange="bindregionchange" :bindpoitap="bindpoitap" :bindcallouttap="bindcallouttap" :bindcontroltap="bindcontroltap" :bindmarkertap="bindmarkertap" :bindlabeltap="bindlabeltap" :bindanchorpointtap="bindanchorpointtap" :bindcontroltap="bindcontroltap" :bindcallouttap="bindcallouttap" :bindupdated="bindupdated" :bindregionchange="bindregionchange" :bindpoitap="bindpoitap" :bindcallouttap="bindcallouttap" :bindcontroltap="bindcontroltap" :bindmarkertap="bindmarkertap" :bindlabeltap="bindlabeltap" :bindanchorpointtap="bindanchorpointtap" :bindcontroltap="bindcontroltap" :bindcallouttap="bindcallouttap" :bindupdated="bindupdated" :bindregionchange="bindregionchange" :bindpoitap="bindpoitap" :bindcallouttap="bindcallouttap" :bindcontroltap="bindcontroltap" :bindmarkertap="bindmarkertap" :bindlabeltap="bindlabeltap" :bindanchorpointtap="bindanchorpointtap" :bindcontroltap="bindcontroltap" :bindcallouttap="bindcallouttap" :bindupdated="bindupdated" :bindregionchange="bindregionchange" :bindpoitap="bindpoitap" :bindcallouttap="bindcallouttap" :bindcontroltap="bindcontroltap" :bindmarkertap="bindmarkertap" :bindlabeltap="bindlabeltap" :bindanchorpointtap="bindanchorpointtap" :bindcontroltap="bindcontroltap" :bindcallouttap="bindcallouttap" :bindupdated="bindupdated" :bindregionchange="bindregionchange" :bindpoitap="bindpoitap" :bindcallouttap="bindcallouttap" :bindcontroltap="bindcontroltap" :bindmarkertap="bindmarkertap" :bindlabeltap="bindlabeltap" :bindanchorpointtap="bindanchorpointtap" :bindcontroltap="bindcontroltap" :bindcallouttap="bindcallouttap" :bindupdated="bindupdated" :bindregionchange="bindregionchange" :bindpoitap="bindpoitap" :bindcallouttap="bindcallouttap" :bindcontroltap="bindcontroltap" :bindmarkertap="bindmarkertap" :bindlabeltap="bindlabeltap" :bindanchorpointtap="bindanchorpointtap" :bindcontroltap="bindcontroltap" :bindcallouttap="bindcallouttap" :bindupdated="bindupdated" :bindregionchange="bindregionchange" :bindpoitap="bindpoitap" :bindcallouttap="bindcallouttap" :bindcontroltap="bindcontroltap" :bindmarkertap="bindmarkertap" :bindlabeltap="bindlabeltap" :bindanchorpointtap="bindanchorpointtap" :bindcontroltap="bindcontroltap" :bindcallouttap="bindcallouttap" :bindupdated="bindupdated" :bindregionchange="bindregionchange
阅读全文