Commit 589c39eb by 张杰

修复地图加载

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