mo-modal-coordinate
v0.0.3
Published
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.3.0.
Downloads
2
Readme
MoModalCoordinate
This library was generated with Angular CLI version 13.3.0.
安装
npm i -S mo-modal-coordinate -registry https://registry.npmjs.org
index.html 引入百度地图
<script type="text/javascript" src="//api.map.baidu.com/api?v=3.0&ak=key"></script>
使用
import { MoModalCoordinateService } from 'mo-modal-coordinate';
constructor(private moCoordinateSrv: MoModalCoordinateService) {}
/*
type Props = {
centerCity?: string; //默认的中心点城市
centerPoint?: string[]; // 默认中心点
zoom?: number; // 地图大小16
};
*/
showModalCoordinate(props?: Props, modalOptions?: ModalOptions){
this.moCoordinateSrv.create(props, modalOptions).subscribe(res => {
if (res) {
// 数据格式 {lat: '113.53062135659549', lng: '34.829533516515895'}
console.log(res)
}
});
}