computed
computed: {
lnglat() {
return {
lng: this.click_station_info.lng,
lat: this.click_station_info.lat,
};
},
},
watch 经纬度的变化
watch: {
lnglat(n, o) {
if (!n.lng || !n.lat) return false;
var gps = coordtransform.wgs84togcj02(n.lng, n.lat);
var bd = coordtransform.gcj02tobd09(gps[0], gps[1])
if(this.m_station_data.title == '新增标站信息'){
this.map.panTo(new BMap.Point(...bd) )
}
this.layer && this.layer.clear();
this.layer && this.layer.clearInfowindow();
const options = {
bgcolorDefault: "#69CE0F",
fgcolorDefault: "black",
intensity: this.intensity,
titleKey: "station",
showValue: false,
defaultValue: "",
icon: "",
coord: "wgs84",
};
this.layer = nMap.nMarkers(
this.map,
[
{
station: this.click_station_info.station,
lng: n.lng,
lat: n.lat,
},
],
options,
{}
);
},
}