|
@@ -5,7 +5,6 @@
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
|
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
|
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
|
|
- <link rel="preconnect" href="https://services.arcgisonline.com">
|
|
|
|
|
<link rel="preconnect" href="https://cdnjs.cloudflare.com">
|
|
<link rel="preconnect" href="https://cdnjs.cloudflare.com">
|
|
|
<title><%= htmlWebpackPlugin.options.title %></title>
|
|
<title><%= htmlWebpackPlugin.options.title %></title>
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/cesium/1.105.1/Cesium.js"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/cesium/1.105.1/Cesium.js"></script>
|
|
@@ -16,43 +15,7 @@
|
|
|
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
|
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
|
|
</noscript>
|
|
</noscript>
|
|
|
<div id="app"></div>
|
|
<div id="app"></div>
|
|
|
- <!-- 瓦片预加载:页面打开即执行,早于 Vue 初始化 -->
|
|
|
|
|
- <div id="cesium-preload" style="position:fixed;width:1px;height:1px;opacity:0;pointer-events:none;z-index:-1;"></div>
|
|
|
|
|
- <script>
|
|
|
|
|
- (function() {
|
|
|
|
|
- // 预加载宏观和中观瓦片(微观用本地静态图,不需要预加载)
|
|
|
|
|
- var views = [
|
|
|
|
|
- {destination:Cesium.Cartesian3.fromDegrees(-15,35.86,45000000)},
|
|
|
|
|
- {destination:Cesium.Cartesian3.fromDegrees(104.19,35.86,14000000)}
|
|
|
|
|
- ];
|
|
|
|
|
- var idx = 0;
|
|
|
|
|
- var viewer = new Cesium.Viewer('cesium-preload', {
|
|
|
|
|
- animation:false, timeline:false, baseLayerPicker:false, geocoder:false,
|
|
|
|
|
- homeButton:false, sceneModePicker:false, navigationHelpButton:false, infoBox:false,
|
|
|
|
|
- fullscreenButton:false, selectionIndicator:false,
|
|
|
|
|
- imageryProvider: new Cesium.ArcGisMapServerImageryProvider({
|
|
|
|
|
- url:'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer'
|
|
|
|
|
- })
|
|
|
|
|
- });
|
|
|
|
|
- viewer.cesiumWidget.creditContainer.style.display='none';
|
|
|
|
|
- viewer.camera.setView(views[0]);
|
|
|
|
|
- function check(){
|
|
|
|
|
- if(viewer.isDestroyed())return;
|
|
|
|
|
- if(viewer.scene.globe.tilesLoaded){
|
|
|
|
|
- idx++;
|
|
|
|
|
- if(idx < views.length){
|
|
|
|
|
- viewer.camera.setView(views[idx]);
|
|
|
|
|
- requestAnimationFrame(check);
|
|
|
|
|
- }else{
|
|
|
|
|
- viewer.destroy();
|
|
|
|
|
- var el=document.getElementById('cesium-preload');
|
|
|
|
|
- if(el)el.remove();
|
|
|
|
|
- }
|
|
|
|
|
- }else{requestAnimationFrame(check);}
|
|
|
|
|
- }
|
|
|
|
|
- requestAnimationFrame(check);
|
|
|
|
|
- })();
|
|
|
|
|
- </script>
|
|
|
|
|
|
|
+ <!-- 本地瓦片,无需预加载 -->
|
|
|
<!-- built files will be auto injected -->
|
|
<!-- built files will be auto injected -->
|
|
|
</body>
|
|
</body>
|
|
|
</html>
|
|
</html>
|