Browse Source

修复地图搜索bug

feature/dev_worklog2
dai 3 years ago
parent
commit
123077da74
  1. 15
      src/views/modules/visual/command/cpts/map.vue

15
src/views/modules/visual/command/cpts/map.vue

@ -209,9 +209,8 @@ export default {
// level: item.level,
center: [item.longitude, item.latitude],
...item,
dotCount2: 222,
dotCount: gridCountData.find((item2) => item2.id == item.orgId)
? gridCountData.find((item2) => item2.id == item.orgId).total
dotCount: gridCountData.find((item2) => item2.orgId == item.id)
? gridCountData.find((item2) => item2.orgId == item.id).total
: "",
},
geometry: {
@ -801,13 +800,15 @@ export default {
searchPos(name) {
return new Promise((reslove) => {
window.AMap.plugin("AMap.PlaceSearch", function () {
window.AMap.plugin("AMap.PlaceSearch", () => {
const city = this.$store.state.user.areaCodePath[1] || "全国";
console.log("搜索区域", city);
// Autocomplete
var autoOptions = {
let autoOptions = {
//city
city: "全国",
city,
};
var autoComplete = new window.AMap.PlaceSearch(autoOptions);
let autoComplete = new window.AMap.PlaceSearch(autoOptions);
autoComplete.search(name, function (status, result) {
reslove(result);
});

Loading…
Cancel
Save