项目列表和分包单位以及迁移人员
This commit is contained in:
69
node_modules/@amap/amap-jsapi-loader/example/AMapUI.html
generated
vendored
Normal file
69
node_modules/@amap/amap-jsapi-loader/example/AMapUI.html
generated
vendored
Normal file
@ -0,0 +1,69 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||
<title>JSAPI Loader</title>
|
||||
<style>
|
||||
html,
|
||||
body,
|
||||
#container {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="container" tabindex="0"></div>
|
||||
|
||||
<script src="../dist/index.js"></script>
|
||||
<script>
|
||||
AMapLoader.load({
|
||||
key: '',//首次load必填
|
||||
version: '2.0Beta',
|
||||
plugins: ['AMap.Scale'],
|
||||
AMapUI: {
|
||||
plugins: ['overlay/SimpleMarker'],
|
||||
}
|
||||
}).then((AMap) => {
|
||||
map = new AMap.Map('container');
|
||||
map.addControl(new AMap.Scale());
|
||||
new AMapUI.SimpleMarker({
|
||||
|
||||
//前景文字
|
||||
iconLabel: 'A',
|
||||
|
||||
//图标主题
|
||||
iconTheme: 'default',
|
||||
|
||||
//背景图标样式
|
||||
iconStyle: 'red',
|
||||
|
||||
//...其他Marker选项...,不包括content
|
||||
map: map,
|
||||
position: map.getCenter()
|
||||
});
|
||||
}).catch((e) => {
|
||||
console.error(e);
|
||||
});
|
||||
setTimeout(function () {
|
||||
AMapLoader.load({
|
||||
plugins: ['AMap.MapType']
|
||||
}).then((AMap) => {
|
||||
map.addControl(new AMap.MapType())
|
||||
}).catch((e) => {
|
||||
console.error(e);
|
||||
});
|
||||
}, 5000);
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
76
node_modules/@amap/amap-jsapi-loader/example/Loca.html
generated
vendored
Normal file
76
node_modules/@amap/amap-jsapi-loader/example/Loca.html
generated
vendored
Normal file
@ -0,0 +1,76 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||
<title>JSAPI Loader</title>
|
||||
<style>
|
||||
html,
|
||||
body,
|
||||
#container {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="container" tabindex="0"></div>
|
||||
<script src="https://a.amap.com/Loca/static/mock/districts.js"></script>
|
||||
<script src="../dist/index.js"></script>
|
||||
<script>
|
||||
AMapLoader.load({
|
||||
key: 'd3c5511c8a102496b1fdb985e6ca1cd7',//首次load必填
|
||||
// version: '2.0',
|
||||
Loca: {
|
||||
version: '2.0.0beta'
|
||||
}
|
||||
}).then((AMap) => {
|
||||
var map = new AMap.Map('container', {
|
||||
zoom: 4,
|
||||
center: [107.4976, 32.1697],
|
||||
features: ['bg', 'road'],
|
||||
// Loca 自 1.2.0 起 viewMode 模式默认为 3D,如需 2D 模式,请显示配置。
|
||||
// viewMode: '3D'
|
||||
});
|
||||
|
||||
var layer = new Loca.PointLayer({
|
||||
map: map
|
||||
});
|
||||
|
||||
layer.setData(districts, {
|
||||
// 指定经纬度所在字段
|
||||
lnglat: 'center'
|
||||
});
|
||||
|
||||
layer.setOptions({
|
||||
style: {
|
||||
// 圆形半径,单位像素
|
||||
radius: 5,
|
||||
// 填充颜色
|
||||
color: '#07E8E4',
|
||||
// 描边颜色
|
||||
borderColor: '#5DFBF9',
|
||||
// 描边宽度,单位像素
|
||||
borderWidth: 1,
|
||||
// 透明度 [0-1]
|
||||
opacity: 0.9,
|
||||
}
|
||||
});
|
||||
|
||||
layer.render();
|
||||
|
||||
}).catch((e) => {
|
||||
console.error(e);
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
94
node_modules/@amap/amap-jsapi-loader/example/Multi.html
generated
vendored
Normal file
94
node_modules/@amap/amap-jsapi-loader/example/Multi.html
generated
vendored
Normal file
@ -0,0 +1,94 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||
<title>JSAPI Loader</title>
|
||||
<style>
|
||||
html,
|
||||
body,
|
||||
#container {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="container" tabindex="0"></div>
|
||||
<script src="https://a.amap.com/Loca/static/mock/districts.js"></script>
|
||||
<script src="../dist/index.js"></script>
|
||||
<script>
|
||||
AMapLoader.load({
|
||||
key: '',//首次load必填
|
||||
version: '1.4.15',
|
||||
AMapUI: {
|
||||
plugins: ['overlay/SimpleMarker'],
|
||||
},
|
||||
Loca: {
|
||||
version: '1.3.2'
|
||||
}
|
||||
}).then((AMap) => {
|
||||
var map = new AMap.Map('container', {
|
||||
zoom: 4,
|
||||
center: [107.4976, 32.1697],
|
||||
features: ['bg', 'road'],
|
||||
// Loca 自 1.2.0 起 viewMode 模式默认为 3D,如需 2D 模式,请显示配置。
|
||||
// viewMode: '3D'
|
||||
});
|
||||
|
||||
new AMapUI.SimpleMarker({
|
||||
|
||||
//前景文字
|
||||
iconLabel: 'A',
|
||||
|
||||
//图标主题
|
||||
iconTheme: 'default',
|
||||
|
||||
//背景图标样式
|
||||
iconStyle: 'red',
|
||||
|
||||
//...其他Marker选项...,不包括content
|
||||
map: map,
|
||||
position: map.getCenter()
|
||||
});
|
||||
var layer = new Loca.PointLayer({
|
||||
map: map
|
||||
});
|
||||
|
||||
layer.setData(districts, {
|
||||
// 指定经纬度所在字段
|
||||
lnglat: 'center'
|
||||
});
|
||||
|
||||
layer.setOptions({
|
||||
style: {
|
||||
// 圆形半径,单位像素
|
||||
radius: 5,
|
||||
// 填充颜色
|
||||
color: '#07E8E4',
|
||||
// 描边颜色
|
||||
borderColor: '#5DFBF9',
|
||||
// 描边宽度,单位像素
|
||||
borderWidth: 1,
|
||||
// 透明度 [0-1]
|
||||
opacity: 0.9,
|
||||
}
|
||||
});
|
||||
|
||||
layer.render();
|
||||
|
||||
}).catch((e) => {
|
||||
console.error(e);
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
36
node_modules/@amap/amap-jsapi-loader/example/example-es6.html
generated
vendored
Normal file
36
node_modules/@amap/amap-jsapi-loader/example/example-es6.html
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||
<title>JSAPI Loader - ES6</title>
|
||||
<style>
|
||||
html, body, #container {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container" tabindex="0"></div>
|
||||
<script type="module">
|
||||
import AMapLoader from '../src/index.js';
|
||||
AMapLoader.load({
|
||||
key:'',//必填
|
||||
version:'2.0',
|
||||
plugins:['AMap.Scale']
|
||||
}).then((AMap)=>{
|
||||
debugger
|
||||
var map = new AMap.Map('container');
|
||||
map.addControl(new AMap.Scale())
|
||||
}).catch((e)=>{
|
||||
console.error(e);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
46
node_modules/@amap/amap-jsapi-loader/example/example.html
generated
vendored
Normal file
46
node_modules/@amap/amap-jsapi-loader/example/example.html
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||
<title>AMap JSAPI Loader</title>
|
||||
<style>
|
||||
html, body, #container {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container" tabindex="0"></div>
|
||||
|
||||
<script src="https://webapi.amap.com/loader.js"></script>
|
||||
<script>
|
||||
AMapLoader.load({ //首次调用 load
|
||||
key:'你申请的高德开放平台 Web 端 key',//首次load key为必填
|
||||
version:'2.0',
|
||||
plugins:['AMap.Scale','AMap.ToolBar']
|
||||
}).then((AMap)=>{
|
||||
map = new AMap.Map('container');
|
||||
map.addControl(new AMap.Scale())
|
||||
map.addControl(new AMap.ToolBar())
|
||||
map.add(new AMap.Marker({
|
||||
position:map.getCenter()
|
||||
}));
|
||||
}).catch((e)=>{
|
||||
console.error(e);
|
||||
});
|
||||
|
||||
AMapLoader.load({ //可多次调用load
|
||||
plugins:['AMap.MapType']
|
||||
}).then((AMap)=>{
|
||||
map.addControl(new AMap.MapType())
|
||||
}).catch((e)=>{
|
||||
console.error(e);
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
2
node_modules/@amap/amap-jsapi-loader/example/libs/chai.min.js
generated
vendored
Normal file
2
node_modules/@amap/amap-jsapi-loader/example/libs/chai.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/@amap/amap-jsapi-loader/example/libs/mocha.min.css
generated
vendored
Normal file
1
node_modules/@amap/amap-jsapi-loader/example/libs/mocha.min.css
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
@charset "utf-8";body{margin:0}#mocha{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;margin:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha .hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial,sans-serif}#mocha .test.pass.medium .duration{background:#c09853}#mocha .test.pass.slow .duration{background:#b94a48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;max-width:85%;max-width:calc(100% - 42px);word-wrap:break-word;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee;border-radius:3px}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail,#mocha-report.pending .test.fail,#mocha-report.pending .test.pass{display:none}#mocha-report.pending .test.pass.pending{display:block}#mocha-error{color:#c00;font-size:1.5em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888;z-index:1}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}#mocha-stats canvas{width:40px;height:40px}#mocha code .comment{color:#ddd}#mocha code .init{color:#2f6fad}#mocha code .string{color:#5890ad}#mocha code .keyword{color:#8a6343}#mocha code .number{color:#2f6fad}@media screen and (max-device-width:480px){#mocha{margin:60px 0}#mocha #stats{position:absolute}}
|
2
node_modules/@amap/amap-jsapi-loader/example/libs/mocha.min.js
generated
vendored
Normal file
2
node_modules/@amap/amap-jsapi-loader/example/libs/mocha.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
287
node_modules/@amap/amap-jsapi-loader/example/test.html
generated
vendored
Normal file
287
node_modules/@amap/amap-jsapi-loader/example/test.html
generated
vendored
Normal file
@ -0,0 +1,287 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||
<title>JSAPI Loader</title>
|
||||
<style>
|
||||
html,
|
||||
body,
|
||||
#container {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="mocha"></div>
|
||||
|
||||
<link rel="stylesheet" href="./libs/mocha.min.css" />
|
||||
<script src="./libs/chai.min.js"></script>
|
||||
<script src="./libs/mocha.min.js"></script>
|
||||
|
||||
<script>
|
||||
mocha.setup('bdd');
|
||||
mocha.traceIgnores = ['mocha.min.js', 'chai.min.js'];
|
||||
expect = chai.expect;
|
||||
</script>
|
||||
<div id="container" tabindex="0"></div>
|
||||
|
||||
<script src="../dist/index.js"></script>
|
||||
<script>
|
||||
// 请把 key 写在这里
|
||||
const JSAPIKey = '';
|
||||
const chai = window.chai;
|
||||
const mocha = window.mocha;
|
||||
mocha.setup({
|
||||
timeout: '5000',
|
||||
ui: 'bdd',
|
||||
});
|
||||
const expect = chai.expect;
|
||||
describe('JSAPI', () => {
|
||||
beforeEach(function () {
|
||||
AMapLoader.reset()
|
||||
});
|
||||
|
||||
it('Simple', (done) => {
|
||||
AMapLoader.load({
|
||||
key: JSAPIKey,//首次load必填
|
||||
version: '2.0',
|
||||
plugins: ['AMap.Scale'],
|
||||
AMapUI: {
|
||||
plugins: ['overlay/SimpleMarker']
|
||||
}
|
||||
}).then(() => {
|
||||
expect(Boolean(window.AMap)).eq(true)
|
||||
expect(Boolean(window.AMapUI)).eq(true)
|
||||
expect(Boolean(window.AMapUI.SimpleMarker)).eq(true)
|
||||
expect(Boolean(window.Loca)).eq(false)
|
||||
done();
|
||||
});
|
||||
|
||||
});
|
||||
it('Request with AMapUI Loca', (done) => {
|
||||
AMapLoader.load({
|
||||
key: JSAPIKey,//首次load必填
|
||||
version: '1.4.15',
|
||||
plugins: ['AMap.Scale'],
|
||||
AMapUI: {
|
||||
plugins: ['overlay/SimpleMarker']
|
||||
},
|
||||
Loca: {
|
||||
version: '1.3.2'
|
||||
}
|
||||
}).then(() => {
|
||||
expect(Boolean(window.AMap)).eq(true)
|
||||
expect(Boolean(window.AMapUI)).eq(true)
|
||||
expect(Boolean(window.AMapUI.SimpleMarker)).eq(true)
|
||||
|
||||
expect(Boolean(window.Loca)).eq(true)
|
||||
done();
|
||||
});
|
||||
|
||||
});
|
||||
it('fail with multi version', (done) => {
|
||||
AMapLoader.load({
|
||||
key: JSAPIKey,//首次load必填
|
||||
version: '2.0',
|
||||
}).then(() => {
|
||||
done()
|
||||
});
|
||||
AMapLoader.load({
|
||||
key: JSAPIKey,//首次load必填
|
||||
version: '1.4.15',
|
||||
}).then(() => {
|
||||
done(Error('should not here'))
|
||||
})
|
||||
.catch(err => {
|
||||
try {
|
||||
expect(err).eq('不允许多个版本 JSAPI 混用')
|
||||
|
||||
} catch (error) {
|
||||
done(error)
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
it('fail with multi key', (done) => {
|
||||
AMapLoader.load({
|
||||
key: JSAPIKey,//首次load必填
|
||||
version: '2.0',
|
||||
}).then(() => {
|
||||
done()
|
||||
});
|
||||
AMapLoader.load({
|
||||
key: 'asdfas',//首次load必填
|
||||
}).then(() => {
|
||||
done(Error('should not here'))
|
||||
})
|
||||
.catch(err => {
|
||||
try {
|
||||
expect(err).eq('多个不一致的 key')
|
||||
|
||||
} catch (error) {
|
||||
done(error)
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
describe('AMapUI', () => {
|
||||
beforeEach(function () {
|
||||
AMapLoader.reset()
|
||||
});
|
||||
|
||||
it('version', (done) => {
|
||||
AMapLoader.load({
|
||||
key: JSAPIKey,//首次load必填
|
||||
version: '1.4.15',
|
||||
AMapUI: {
|
||||
version: '1.1',
|
||||
plugins: ['misc/PathSimplifier']
|
||||
}
|
||||
}).then(() => {
|
||||
expect(Boolean(window.AMap)).eq(true)
|
||||
expect(Boolean(window.AMapUI)).eq(true)
|
||||
expect(Boolean(window.AMapUI.PathSimplifier)).eq(true)
|
||||
expect(Boolean(window.AMapUI.version.startsWith('1.1'))).eq(true)
|
||||
done();
|
||||
}).catch(done);
|
||||
});
|
||||
|
||||
it('async', (done) => {
|
||||
console.log(window.AMap);
|
||||
AMapLoader.load({
|
||||
key: JSAPIKey,//首次load必填
|
||||
version: '1.4.15',
|
||||
AMapUI: {
|
||||
version: '1.0',
|
||||
plugins: ['overlay/SimpleMarker']
|
||||
}
|
||||
}).then(() => {
|
||||
AMapLoader.load({
|
||||
AMapUI: {
|
||||
plugins: ['overlay/SimpleInfoWindow']
|
||||
}
|
||||
}).then(() => {
|
||||
expect(Boolean(window.AMap)).eq(true)
|
||||
expect(Boolean(window.AMapUI.version.startsWith('1.0'))).eq(true)
|
||||
expect(Boolean(window.AMapUI.SimpleMarker)).eq(true)
|
||||
expect(Boolean(window.AMapUI.SimpleInfoWindow)).eq(true)
|
||||
done()
|
||||
});
|
||||
}).catch(done);
|
||||
})
|
||||
});
|
||||
|
||||
describe('Loca', () => {
|
||||
beforeEach(function () {
|
||||
AMapLoader.reset()
|
||||
});
|
||||
|
||||
it('version', (done) => {
|
||||
AMapLoader.load({
|
||||
key: JSAPIKey,//首次load必填
|
||||
version: '1.4.15',
|
||||
Loca: {
|
||||
version: '1.3.1'
|
||||
}
|
||||
}).then(() => {
|
||||
expect(Boolean(window.AMap)).eq(true)
|
||||
expect(Boolean(window.Loca)).eq(true)
|
||||
expect(window.Loca.version).eq('1.3.1')
|
||||
done()
|
||||
}).catch(done);
|
||||
});
|
||||
it('fail with jsapi2.0', (done) => {
|
||||
AMapLoader.load({
|
||||
key: JSAPIKey,//首次load必填
|
||||
version: '2.0',
|
||||
Loca: {
|
||||
version: '1.3.1'
|
||||
}
|
||||
}).then(() => {
|
||||
done(Error('should not here'))
|
||||
}).catch(err => {
|
||||
try {
|
||||
expect(err).eq("Loca 暂不适配 JSAPI 2.0,请使用 1.4.15")
|
||||
done()
|
||||
} catch (error) {
|
||||
done(error)
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
it('async', (done) => {
|
||||
AMapLoader.load({
|
||||
key: JSAPIKey,//首次load必填
|
||||
version: '1.4.15',
|
||||
Loca: {
|
||||
version: '1.2.1'
|
||||
}
|
||||
}).then(() => {
|
||||
expect(Boolean(window.AMap)).eq(true)
|
||||
expect(Boolean(window.Loca)).eq(true)
|
||||
expect(window.Loca.version).eq('1.2.1')
|
||||
AMapLoader.load({
|
||||
Loca: {
|
||||
version: '1.2.1'
|
||||
}
|
||||
}).then(() => {
|
||||
expect(Boolean(window.AMap)).eq(true)
|
||||
expect(Boolean(window.Loca)).eq(true)
|
||||
expect(window.Loca.version).eq('1.2.1')
|
||||
done()
|
||||
}).catch(done);
|
||||
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
describe('Advance', () => {
|
||||
beforeEach(function () {
|
||||
AMapLoader.reset()
|
||||
});
|
||||
it('Multi', (done) => {
|
||||
AMapLoader.load({ key: JSAPIKey, version: '1.4.15' }).then(() => {
|
||||
expect(Boolean(window.AMap)).eq(true);
|
||||
expect(window.AMap.v).eq('1.4.15');
|
||||
|
||||
expect(Boolean(window.AMapUI)).eq(false);
|
||||
expect(Boolean(window.Loca)).eq(false);
|
||||
AMapLoader.load({ AMapUI: {} }).then(() => {
|
||||
expect(Boolean(window.AMap)).eq(true);
|
||||
expect(window.AMap.v).eq('1.4.15');
|
||||
|
||||
expect(Boolean(window.AMapUI)).eq(true);
|
||||
expect(window.AMapUI.version.startsWith('1.1')).eq(true);
|
||||
expect(Boolean(window.Loca)).eq(false);
|
||||
AMapLoader.load({ Loca: {} }).then(() => {
|
||||
expect(Boolean(window.AMap)).eq(true);
|
||||
expect(window.AMap.v).eq('1.4.15');
|
||||
expect(Boolean(window.AMapUI)).eq(true);
|
||||
expect(window.AMapUI.version.startsWith('1.1')).eq(true);
|
||||
expect(Boolean(window.Loca)).eq(true);
|
||||
expect(window.Loca.version).eq('1.3.2');
|
||||
done()
|
||||
})
|
||||
})
|
||||
}).catch(done)
|
||||
})
|
||||
})
|
||||
mocha.run()
|
||||
</script>
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
Reference in New Issue
Block a user