fix: 标记位置加载js报错的问题

This commit is contained in:
caoqianming 2024-11-20 17:39:05 +08:00
parent fed5c23a28
commit 78053dac34
2 changed files with 3 additions and 2 deletions

View File

@ -91,7 +91,8 @@ export default {
mounted(){
let that = this;
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.canUseMap = true;
})

View File

@ -154,7 +154,7 @@ export default {
this.getArea();
let that = this;
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.canUseMap = true;
})