| | |
| | | import mapServer from "./mapServer";
|
| | |
|
| | | const mapViewer = {
|
| | | initMap() {
|
| | | var earthCtrl = new SmartEarth.EarthCtrl("cesiumContainer", {
|
| | | StaticFileBaseUrl: config.StaticFileBaseUrl,
|
| | | window.earthCtrl = new SmartEarth.EarthCtrl("sdkContainer", {
|
| | | // 隐藏默认底图
|
| | | defaultImagery: false,
|
| | | // 隐藏logo
|
| | | printLog: false
|
| | | // sceneMode: SmartEarth.Cesium.SceneMode.SCENE2D
|
| | | });
|
| | | },
|
| | | setMapLocaTion(res) {
|
| | | window.Cesium = SmartEarth.Cesium;
|
| | | window.Viewer = earthCtrl.viewer;
|
| | | Viewer.scene.globe.baseColor = Cesium.Color.fromCssColorString("#A9A9A9"); //设置地球颜色
|
| | | // 清空默认底图
|
| | | Viewer.imageryLayers.removeAll();
|
| | |
|
| | | },
|
| | | mapServer.addServer({
|
| | | sourceType: "arcgis",
|
| | | url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"
|
| | | });
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | // mapServer.addServer({
|
| | | // sourceType: "geoserver",
|
| | | // url: "https://cim.smartearth.cn/geoserver/PolygonFeature/ows",
|
| | | // layer: "PolygonFeature:GeoEntity"
|
| | | // });
|
| | | }
|
| | | };
|
| | | export default mapViewer; |