Merge branch 'develop' of https://gitlab.eascs.com/tms-ui/tms-obc-web into develop

This commit is contained in:
wangshiming
2021-12-20 10:13:31 +08:00
11 changed files with 18 additions and 288 deletions

View File

@ -1,6 +0,0 @@
<div nz-row style="margin-bottom: 24px">
<div nz-col nzSpan="8">
<input nz-input id="pickerInput" [(ngModel)]="addressInput" placeholder="请输入地址" />
</div>
</div>
<div class="map-container" id="container" tabindex="0" style="width: 800px; height: 500px"></div>

View File

@ -1,73 +0,0 @@
/*
* @Author: your name
* @Date: 2021-12-06 20:30:17
* @LastEditTime: 2021-12-20 09:36:56
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \tms-obc-web\src\app\routes\order-management\components\gaode-map\gaode-map.component.ts
*/
import { Component, Input, OnInit, Output, EventEmitter, OnDestroy } from '@angular/core';
import { _HttpClient } from '@delon/theme';
import { load } from '@amap/amap-jsapi-loader';
import { BaseService } from 'src/app/shared/services';
import { throwError } from 'rxjs';
import AMapLoader from '@amap/amap-jsapi-loader';
@Component({
selector: 'app-gaode-map',
templateUrl: './gaode-map.component.html'
})
export class GaodeMapComponent implements OnInit, OnDestroy {
addressInput: any;
aMap: any;
constructor(private service: BaseService) {}
ngOnInit(): void {
this.mapInit();
// this.PoiPicker();
}
ngOnDestroy(): void {
if (this.aMap) {
this.aMap.destroy();
}
}
mapInit() {
AMapLoader.load({
// 首次调用 load
key: '63f9573ca55fef2b92d4ffe0c85dea8f', // 申请好的Web端开发者Key首次调用 load 时必填
version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
plugins: [
// 需要使用的的插件列表,如比例尺'AMap.Scale'等
'AMap.Scale',
'AMap.ToolBar',
'AMap.MapType',
'AMap.Driving',
'AMap.Geolocation'
],
AMapUI: {
// 是否加载 AMapUI缺省不加载
version: '1.1', // AMapUI 缺省 1.1
plugins: [] // 需要加载的 AMapUI ui插件
},
Loca: {
// 是否加载 Loca 缺省不加载
version: '2.0' // Loca 版本,缺省 1.3.2
}
})
.then(AMap => {
console.log(AMap);
this.aMap = new AMap.Map('container', {
viewMode: '2D', // 默认使用 2D 模式,如果希望使用带有俯仰角的 3D 模式,请设置 viewMode: '3D',
zoom: 16
});
this.aMap.on('complete', () => {
this.service.msgSrv.info('地图加载完成 !');
});
})
.catch(e => {
throwError(e);
});
}
}