fix: 标记位置加载js报错的问题
This commit is contained in:
parent
fed5c23a28
commit
78053dac34
|
@ -91,7 +91,8 @@ export default {
|
||||||
mounted(){
|
mounted(){
|
||||||
let that = this;
|
let that = this;
|
||||||
let host = window.location.host;
|
let host = window.location.host;
|
||||||
let jsUrl = host.indexOf('localhost')>-1?'http://222.222.144.147:6013/jsmap/jsmap.js':host+'/jsmap/jsmap.js';
|
let jsUrl = host.indexOf('localhost')>-1?'http://222.222.144.147:6013/jsmap/jsmap.js':window.location.protocol + "//" + host+'/jsmap/jsmap.js';
|
||||||
|
console.log(jsUrl)
|
||||||
that.loadScript('mapId',jsUrl, () => {
|
that.loadScript('mapId',jsUrl, () => {
|
||||||
that.canUseMap = true;
|
that.canUseMap = true;
|
||||||
})
|
})
|
||||||
|
|
|
@ -154,7 +154,7 @@ export default {
|
||||||
this.getArea();
|
this.getArea();
|
||||||
let that = this;
|
let that = this;
|
||||||
let host = window.location.host;
|
let host = window.location.host;
|
||||||
let jsUrl = host.indexOf('localhost') > -1 ? 'http://222.222.144.147:6013/jsmap/jsmap.js' : host + '/jsmap/jsmap.js';
|
let jsUrl = host.indexOf('localhost') > -1 ? 'http://222.222.144.147:6013/jsmap/jsmap.js' : window.location.protocol + "//" + host+'/jsmap/jsmap.js';
|
||||||
that.loadScript('mapId', jsUrl, () => {
|
that.loadScript('mapId', jsUrl, () => {
|
||||||
that.canUseMap = true;
|
that.canUseMap = true;
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue