Commit 589c39eb by 张杰

修复地图加载

1 parent 901b1182
......@@ -127,7 +127,6 @@
</div>
</template>
<script>
import vue from "vue";
import mapService from "@/utils/mapService.js";
import fenceMap from "./fenceMap.vue";
import userList from "./fence_userlist.vue";
......
......@@ -47,12 +47,9 @@
<!-- 围栏调用地图弹框 /-->
</template>
<script>
import { services } from "../../api";
import remoteLoad from "utils/remoteLoad.js";
import mapService from "utils/mapService.js";
import FenceMapControll from "./FenceMapControll.vue";
const BUSINESS_SERVICE = services.business;
var mapMenu = "";
import { CONSTANT } from "../../constant";
export default {
props: ["fenceMapModalVisible", "init", "readonlyStatus"],
......@@ -98,7 +95,14 @@ export default {
],
};
},
async mounted() {},
async mounted() {
if (window.AMap) {
this.initMap();
} else {
await remoteLoad(`${CONSTANT.AMAP_URL}`, true);
this.initMap();
}
},
watch: {
lng(newVal) {
//this.transfer()
......@@ -116,12 +120,7 @@ export default {
} */
},
async created() {
if (window.AMap) {
this.initMap();
} else {
await remoteLoad(`${CONSTANT.AMAP_URL}`, true);
this.initMap();
}
},
methods: {
initMap() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!