第一次使用,记录下,下次好找
相关地址:
https://www.npmjs.com/package/ngx-amap
https://xieziyu.github.io/ngx-amap/api-doc/index.html
https://lbs.amap.com/dev/mapstyle/edit?styleid=a5852d8c318b404e540496283ab741c4
// 安装插件
npm i ngx-amap --save
// 组件所在的module中导入模块
import { NgxAmapModule } from 'ngx-amap';
imports: [
....
NgxAmapModule.forRoot({
apiKey: '高德官网申请的开发者apikey'
})
],
简单地图的页面展示
<ngx-amap style="height: 600px;" [center]="[116.397428, 39.90923]" [zooms]="[10,20]">
<amap-marker [position]="[116.397428, 39.90923]" ></amap-marker>
</ngx-amap>
热力图具体使用(官方东西太多,不好粘贴):
https://xieziyu.github.io/ngx-amap/#/plugins/amap-heatmap
部分解释:
1、center
center是定位到某个位置[center]='['经度', '维度']
,