fix: 高德地图v2支持版本

This commit is contained in:
thinkinggis 2021-07-13 20:36:38 +08:00
parent 3fa1997dbd
commit 27eb839128
2 changed files with 5 additions and 3 deletions

View File

@ -403,6 +403,7 @@ export default class AMapService
token = AMAP_API_KEY,
mapInstance,
plugin = [],
version = AMAP_VERSION,
...rest
} = this.config;
// 高德地图创建独立的container
@ -464,7 +465,7 @@ export default class AMapService
plugin.push('Map3D');
AMapLoader.load({
key: token, // 申请好的Web端开发者Key首次调用 load 时必填
version: AMAP_VERSION, // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
version, // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
plugins: plugin, // 需要使用的的插件列表,如比例尺'AMap.Scale'等
})
.then((AMap) => {

View File

@ -1,5 +1,5 @@
import { LineLayer, Scene } from '@antv/l7';
import { GaodeMap } from '@antv/l7-maps';
import { GaodeMapV2 } from '@antv/l7-maps';
import * as React from 'react';
export default class Amap2demo_arcLineLinear extends React.Component {
@ -13,12 +13,13 @@ export default class Amap2demo_arcLineLinear extends React.Component {
public async componentDidMount() {
const scene = new Scene({
id: 'map',
map: new GaodeMap({
map: new GaodeMapV2({
pitch: 40,
center: [107.77791556935472, 35.443286920228644],
zoom: 2.9142882493605033,
viewMode: '3D',
style: 'dark',
version: '2.0.4',
}),
});
this.scene = scene;