update
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 3.8 KiB |
+22
-20
@@ -27,26 +27,28 @@ export const Map = {
|
||||
* @param option 地图配置
|
||||
*/
|
||||
initMap({ el, option }: InitMap) {
|
||||
AMapLoader.load({
|
||||
key: '4bbcb216b889f2d612cbed05ae6979c8', // 申请好的Web端开发者Key,首次调用 load 时必填
|
||||
// version: '1.4.15', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
||||
version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
||||
plugins: mapPlugin, // 需要使用的的插件列表,如比例尺'AMap.Scale'等
|
||||
}).then((res) => {
|
||||
AMap = res;
|
||||
const { zoom, center, mapStyle } = { ...defaultOption, ...option };
|
||||
//基本地图加载
|
||||
this.map = new AMap.Map(el, {
|
||||
resizeEnable: true,
|
||||
center: center,
|
||||
zoom: zoom,
|
||||
mapStyle: 'amap://styles/darkblue',
|
||||
version: '2.0',
|
||||
});
|
||||
// 异步同时加载多个插件
|
||||
new AMap.plugin(mapPlugin, () => {
|
||||
this.drawInnerLine();
|
||||
this.drawOutLine();
|
||||
return new Promise((resolve) => {
|
||||
AMapLoader.load({
|
||||
key: '4bbcb216b889f2d612cbed05ae6979c8', // 申请好的Web端开发者Key,首次调用 load 时必填
|
||||
version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
||||
plugins: mapPlugin, // 需要使用的的插件列表,如比例尺'AMap.Scale'等
|
||||
}).then((res) => {
|
||||
AMap = res;
|
||||
const { zoom, center, mapStyle } = { ...defaultOption, ...option };
|
||||
//基本地图加载
|
||||
this.map = new AMap.Map(el, {
|
||||
resizeEnable: true,
|
||||
center: center,
|
||||
zoom: zoom,
|
||||
mapStyle: 'amap://styles/darkblue',
|
||||
version: '2.0',
|
||||
});
|
||||
// 异步同时加载多个插件
|
||||
new AMap.plugin(mapPlugin, () => {
|
||||
this.drawInnerLine();
|
||||
this.drawOutLine();
|
||||
});
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
} /**
|
||||
|
||||
+29
-2
@@ -1,7 +1,34 @@
|
||||
import type { App } from 'vue';
|
||||
import { Form, Input, Button, Radio, Modal, Table, Select, Cascader, Spin, ConfigProvider } from 'ant-design-vue';
|
||||
import {
|
||||
Form,
|
||||
Input,
|
||||
Button,
|
||||
Radio,
|
||||
RadioGroup,
|
||||
RadioButton,
|
||||
DatePicker,
|
||||
Modal,
|
||||
Table,
|
||||
Select,
|
||||
Cascader,
|
||||
Spin,
|
||||
ConfigProvider,
|
||||
} from 'ant-design-vue';
|
||||
import dataV from '@iamzzg/data-view/dist/vue3/datav.map.vue.esm';
|
||||
|
||||
export default function registerGlobComp(app: App) {
|
||||
app.use(dataV).use(Button).use(Form).use(Input).use(Radio).use(Modal).use(Table).use(Select).use(Cascader).use(Spin).use(ConfigProvider);
|
||||
app.use(dataV)
|
||||
.use(Button)
|
||||
.use(Form)
|
||||
.use(Input)
|
||||
.use(Radio)
|
||||
.use(RadioGroup)
|
||||
.use(RadioButton)
|
||||
.use(DatePicker)
|
||||
.use(Modal)
|
||||
.use(Table)
|
||||
.use(Select)
|
||||
.use(Cascader)
|
||||
.use(Spin)
|
||||
.use(ConfigProvider);
|
||||
}
|
||||
Reference in New Issue
Block a user