Commit 74e9eed3 by 前端

临时解决版本共存问题

1 parent 928ff08c
...@@ -273,6 +273,9 @@ export default { ...@@ -273,6 +273,9 @@ export default {
mapObj.plugin(["AMap.CircleEditor"], () => { mapObj.plugin(["AMap.CircleEditor"], () => {
this.circleEditor = new AMap.CircleEditor(mapObj, this.fenceCircle); this.circleEditor = new AMap.CircleEditor(mapObj, this.fenceCircle);
// this.circleEditor.on("adjust", function (e) {
// console.log(e);
// });
AMap.event.addListener(this.circleEditor, "adjust", (e) => { AMap.event.addListener(this.circleEditor, "adjust", (e) => {
this.radius = e.radius / 1; this.radius = e.radius / 1;
this.$emit("onUpdateMapData", { this.$emit("onUpdateMapData", {
......
...@@ -202,7 +202,6 @@ import InfiniteLoading from "vue-infinite-loading"; ...@@ -202,7 +202,6 @@ import InfiniteLoading from "vue-infinite-loading";
import MapControll from "./MapControll.vue"; import MapControll from "./MapControll.vue";
import { replayShortcuts } from "@/common/index"; import { replayShortcuts } from "@/common/index";
import { GET_ELECFENCE_INFO } from "@/api/services/fence"; import { GET_ELECFENCE_INFO } from "@/api/services/fence";
import listJson from "./test.json";
export default { export default {
data() { data() {
let checkDaterange = (rule, vaule, cb) => { let checkDaterange = (rule, vaule, cb) => {
...@@ -444,7 +443,6 @@ export default { ...@@ -444,7 +443,6 @@ export default {
MONITOR_SERVICE.getTrackHistory(params).then((result) => { MONITOR_SERVICE.getTrackHistory(params).then((result) => {
//result = mock.getTrackHistory //result = mock.getTrackHistory
console.log(result); console.log(result);
result = listJson;
if (result.code == "200") { if (result.code == "200") {
let data = result.data; let data = result.data;
this.replayData = data; this.replayData = data;
......
...@@ -5,13 +5,33 @@ export const mapInit = params => { ...@@ -5,13 +5,33 @@ export const mapInit = params => {
let options = params || {}; let options = params || {};
// let plugins = options.plugins|| CONSTANT.MAP_PLUGINS; // let plugins = options.plugins|| CONSTANT.MAP_PLUGINS;
// let version = options.version || '2.0'; // let version = options.version || '2.0';
if(window.AMap){ console.log(window.window)
resolve(window.AMap) console.log(window.AMap);
return false; 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}; let mapConfig ={...options};
mapConfig.key = CONSTANT.MAP_KEY; // 申请好的Web端开发者Key,首次调用 load 时必填 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'等 mapConfig.plugins = options.plugins|| CONSTANT.MAP_PLUGINS;// 需要使用的的插件列表,如比例尺'AMap.Scale'等
if(options.AMapUI){ if(options.AMapUI){
mapConfig.AMapUI = options.AMapUI; mapConfig.AMapUI = options.AMapUI;
...@@ -22,9 +42,8 @@ export const mapInit = params => { ...@@ -22,9 +42,8 @@ export const mapInit = params => {
resolve(AMap); resolve(AMap);
}) })
.catch((error) => { .catch((error) => {
console.log(error); window.location.reload();
reject(error); reject(error);
}); });
}) })
} }
\ No newline at end of file \ 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!