| | |
| | | <div |
| | | @click="changeMenulayer" |
| | | class="center CenDiv" |
| | | :class="{ center1: centerFlag }" |
| | | > |
| | | <div |
| | | title="底图切换" |
| | | id="cenBg" |
| | | v-bind:class="{ active: isActive, menuLayer: isMenuLayer }" |
| | | class="mapBaseMap" |
| | | ></div> |
| | | |
| | | </div> |
| | |
| | | class="changeMapType" |
| | | > |
| | | <div |
| | | title="2/3维切换" |
| | | id="cenBg" |
| | | :class="show2DMap ? 'mapTypeTwo' : 'mapTypeThree'" |
| | | ></div> |
| | |
| | | methods: { |
| | | |
| | | init2DMap() { |
| | | var vectorLayer = new TileLayer({ |
| | | source: new XYZ({ |
| | | url: "http://wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=7&x={x}&y={y}&z={z}", |
| | | }), |
| | | }) |
| | | var imageLayer = new TileLayer({ |
| | | source: new XYZ({ |
| | | url: "http://wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=6&x={x}&y={y}&z={z}", |
| | | }), |
| | | }) |
| | | // var vectorLayer = new TileLayer({ |
| | | // source: new XYZ({ |
| | | // url: "http://wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=7&x={x}&y={y}&z={z}", |
| | | // }), |
| | | // }) |
| | | // var imageLayer = new TileLayer({ |
| | | // source: new XYZ({ |
| | | // url: "http://wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=6&x={x}&y={y}&z={z}", |
| | | // }), |
| | | // }) |
| | | window.map = new Map({ |
| | | target: "mapol", |
| | | layers: [imageLayer, vectorLayer], |
| | | layers: [], |
| | | view: new View({ |
| | | center: [105.02, 34.9], |
| | | zoom: 4, |
| | | projection: "EPSG:4326", |
| | | minZoom: 4, |
| | | minZoom: 5, |
| | | }), |
| | | controls: defaultControls().extend([ |
| | | new FullScreen(), |
| | |
| | | ]), |
| | | interactions: defaultInteractions().extend([new DragRotateAndZoom()]), |
| | | }) |
| | | |
| | | window.olBaseMapLayer = new TileLayer({ |
| | | title: "高德地图", |
| | | source: new XYZ({ |
| | | url: gaoDeBaseUrl[1].url, |
| | | wrapX: false |
| | | }) |
| | | }); |
| | | window.map.addLayer(window.olBaseMapLayer); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // var scaleLine = new ScaleLine({ |
| | | // units: "metric" |
| | | // }); |
| | |
| | | }, |
| | | |
| | | changeMenulayer() { |
| | | this.isActive = !this.isActive |
| | | this.isMenuLayer = !this.isMenuLayer |
| | | this.setLayerVisible() |
| | | this.$bus.$emit("setChangeBaseMapLayer", true) |
| | | // this.isActive = !this.isActive |
| | | // this.isMenuLayer = !this.isMenuLayer |
| | | // this.setLayerVisible() |
| | | }, |
| | | setLayerVisible() { |
| | | if (this.isActive == true) { |
| | |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-content: space-between; |
| | | box-shadow: 3px 3px 6px #666; |
| | | border: 1px solid rgba(204, 204, 204, 0.76); |
| | | // box-shadow: 3px 3px 6px #666; |
| | | // border: 1px solid rgba(204, 204, 204, 0.76); |
| | | border-radius: 5px; |
| | | cursor: pointer; |
| | | } |
| | |
| | | flex-direction: column; |
| | | justify-content: space-between; |
| | | } |
| | | .CenDiv:hover { |
| | | border: 1px solid #409eff; |
| | | } |
| | | // .CenDiv:hover { |
| | | // border: 1px solid #409eff; |
| | | // } |
| | | .active { |
| | | width: 100%; |
| | | height: 100%; |
| | |
| | | .sindagis-map-compass .right:hover { |
| | | background: url("../assets/img/compass.png") -89px -5px / 266px no-repeat; |
| | | } |
| | | |
| | | .mapBaseMap { |
| | | width: 100%; |
| | | height: 100%; |
| | | margin-left: 10px; |
| | | background-image: url("../assets/img/synthesis/底图.png"); |
| | | background-repeat: no-repeat; |
| | | background-size: contain; |
| | | } |
| | | .changeMapType { |
| | | position: absolute; |
| | | bottom: 1%; |