1.0.1 • Published 9 months ago
vue-zjgf-components-test v1.0.1
install
npm install vue-zjgf-components
全局引入
// main.js
import Vue from "vue";
import zjgfComponents from "vue-zjgf-components";
Vue.use(zjgfComponents);
使用
html
<div style="width: 100%; height: 100%;">
<zjgf-map ref="$map" @ok="mapOk"></zjgf-map>
</div>
javascript
methods: {
// 地图初始化完成
mapOk() {
// 设置中心点
this.$refs.$map.setCenter({
x: 120.76983430070167,// 经度,wgs84坐标系
y: 30.760135460262326,// 纬度,wgs84坐标系
zoom: 15,// 地图层级,默认15
name: "当前位置",// 中心位置名称
});
// 获取中心点附近公服设施
this.$refs.$map.renderNearPOI({
// poiTypes:公服设施类型,可传指定设施类型数组,不传或传null则显示全部,全部类型如下。
// poiTypes:null,// 显示全部公服设施类型
poiTypes: [
"社区综合服务中心_党群服务中心",
"居家养老服务照料中心",
"养老机构",
"社区食堂",
"社区卫生服务站_智慧健康站",
"社区卫生服务中心",
"社区文化活动站",
"四点半学堂_幸福学堂",
"农贸市场",
"小学",
"幼儿园",
"托育机构_社区照护驿站",
"体育馆",
"百姓健身房",
"室外健身器材",
"社区公园",
"健身步道",
"室外球类场地(多功能运动场)",
"垃圾投放点",
"公共厕所",
"充电桩",
],
});
},
},
1.0.1
9 months ago