From dae8fb08b9ff7327da86ed249c9c97a87c90e6f2 Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期二, 16 五月 2023 18:05:34 +0800 Subject: [PATCH] 发布管理,图层管理修改 --- src/components/mapol.vue | 29 +++++++++++++++-------------- 1 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/components/mapol.vue b/src/components/mapol.vue index b668f48..0cb5ad9 100644 --- a/src/components/mapol.vue +++ b/src/components/mapol.vue @@ -35,8 +35,8 @@ <!-- </div>--> <div - v-show="$store.state.isNaviget" class="sindagis-map-compass" + style=" bottom: 130px; right: 35px;" > <span class="left" @@ -98,17 +98,17 @@ init2DMap() { var layerBase = []; if (!is_production) { - // window.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}", - // }), - // }) - window.vectorLayer = new TileLayer({ + 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}", }), }) - layerBase = [vectorLayer] + layerBase = [vectorLayer, imageLayer] } window.map = new Map({ target: "mapol", @@ -147,10 +147,10 @@ - // var scaleLine = new ScaleLine({ - // units: "metric" - // }); - // map.addControl(scaleLine); + var scaleLine = new ScaleLine({ + units: "metric" + }); + map.addControl(scaleLine); map.on("moveend", function (e) { console.log(($(window).width() - $(".ol-scale-line-inner").width()) + "px"); @@ -297,14 +297,15 @@ } .ol-scale-line { bottom: 55px !important; + right: 130px !important; } .sindagis-map-compass { position: absolute; right: 50px; - bottom: 90px; + z-index: 5; - right: 25px; + width: 52px; height: 54px; background: url("../assets/img/compass.png") 0% 0% / 266px no-repeat; -- Gitblit v1.9.3