Commit 74e9eed3 by 前端

临时解决版本共存问题

1 parent 928ff08c
......@@ -273,6 +273,9 @@ export default {
mapObj.plugin(["AMap.CircleEditor"], () => {
this.circleEditor = new AMap.CircleEditor(mapObj, this.fenceCircle);
// this.circleEditor.on("adjust", function (e) {
// console.log(e);
// });
AMap.event.addListener(this.circleEditor, "adjust", (e) => {
this.radius = e.radius / 1;
this.$emit("onUpdateMapData", {
......
......@@ -202,7 +202,6 @@ import InfiniteLoading from "vue-infinite-loading";
import MapControll from "./MapControll.vue";
import { replayShortcuts } from "@/common/index";
import { GET_ELECFENCE_INFO } from "@/api/services/fence";
import listJson from "./test.json";
export default {
data() {
let checkDaterange = (rule, vaule, cb) => {
......@@ -444,7 +443,6 @@ export default {
MONITOR_SERVICE.getTrackHistory(params).then((result) => {
//result = mock.getTrackHistory
console.log(result);
result = listJson;
if (result.code == "200") {
let data = result.data;
this.replayData = data;
......
......@@ -5,26 +5,45 @@ export const mapInit = params => {
let options = params || {};
// let plugins = options.plugins|| CONSTANT.MAP_PLUGINS;
// let version = options.version || '2.0';
if(window.AMap){
resolve(window.AMap)
return false;
}
console.log(window.window)
console.log(window.AMap);
let _list = window.localStorage || {};
// if(window.AMap){
// let _amap = window.AMap|| {};
// console.log(_amap.version)
// if(options.version == _amap.version){
// resolve(window.AMap);
// }else{
// delete window.AMap;
// delete window.AMapUI;
// delete window.Loca;
// // 删除高德地图缓存,防止出现禁止多种API加载方式混用的bug
// for(let k in _list){
// if(k.indexOf('_AMap') == 0){
// localStorage.removeItem(k);
// }
// }
// }
// }
let mapConfig ={...options};
mapConfig.key = CONSTANT.MAP_KEY; // 申请好的Web端开发者Key,首次调用 load 时必填
mapConfig.version = options.version || '2.0';; // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
mapConfig.version = options.version || '2.0'; // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
mapConfig.plugins = options.plugins|| CONSTANT.MAP_PLUGINS;// 需要使用的的插件列表,如比例尺'AMap.Scale'等
if(options.AMapUI){
mapConfig.AMapUI = options.AMapUI;
}
AMapLoader.reset();
AMapLoader.load(mapConfig).then((AMap) => {
window.AMap = AMap;
resolve(AMap);
})
.catch((error) => {
console.log(error);
reject(error);
});
window.AMap = AMap;
resolve(AMap);
})
.catch((error) => {
window.location.reload();
reject(error);
});
})
}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!