diff --git a/src/components/index.vue b/src/components/index.vue index 52105e5..3873be8 100644 --- a/src/components/index.vue +++ b/src/components/index.vue @@ -335,7 +335,7 @@ ChangeBGC() { // 给予gis的方法调用demo A // this.$refs.PathView; - this.$refs["PathView"].REFSFunctionToGis(); + this.$refs["PathView"].REFSFunctionToGis(this.flag); // 给予gis的方法调用demo E console.log(9999); diff --git a/src/components/index.vue b/src/components/index.vue index 52105e5..3873be8 100644 --- a/src/components/index.vue +++ b/src/components/index.vue @@ -335,7 +335,7 @@ ChangeBGC() { // 给予gis的方法调用demo A // this.$refs.PathView; - this.$refs["PathView"].REFSFunctionToGis(); + this.$refs["PathView"].REFSFunctionToGis(this.flag); // 给予gis的方法调用demo E console.log(9999); diff --git a/src/components/site/previewOfSiteStatus.vue b/src/components/site/previewOfSiteStatus.vue index 57c361c..be5e5ae 100644 --- a/src/components/site/previewOfSiteStatus.vue +++ b/src/components/site/previewOfSiteStatus.vue @@ -1000,12 +1000,20 @@ logo: false, slider: false, }); - let Main_Map = new ArcGISTiledMapServiceLayer( + + this.arcgiswhiteMap = new ArcGISTiledMapServiceLayer( + //"http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" + "http://cache1.arcgisonline.cn/arcgis/rest/services/ChinaOnlineCommunity_Mobile/MapServer" + ); + _this.map.addLayer(this.arcgiswhiteMap); + this.arcgiswhiteMap.hide() + this.arcgisMap = new ArcGISTiledMapServiceLayer( "http://map.geoq.cn/arcgis/rest/services/ChinaOnlineStreetPurplishBlue/MapServer" ); - _this.map.addLayer(Main_Map); + _this.map.addLayer(this.arcgisMap); /* _this.map.on("zoom-end", function() { }); + _this.map.on("click", function(e) { }); */ @@ -1152,10 +1160,21 @@ }); }, // 给与gis的方法调动dome - REFSFunctionToGis() { - console.log( - "在index调用到了previewOfSiteStatus中的REFSFunctionToGis方法" - ); + REFSFunctionToGis(type) { + + if (!type) { + //加载黑色arcgis午夜蓝图 + this.arcgiswhiteMap.hide() + this.arcgisMap.show() + } + else + { + //加载蓝色底图 + this.arcgisMap.hide() + this.arcgiswhiteMap.show() + + } + }, }, mounted: function () {