diff --git a/.env.development b/.env.development index be04f184b..b3eeabdfd 100644 --- a/.env.development +++ b/.env.development @@ -8,8 +8,8 @@ VUE_APP_API_SERVER = http://192.168.1.140/api # VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn:41080/api # VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn/api -# VUE_APP_NODE_ENV=dev_sdtdt -VUE_APP_NODE_ENV=dev +VUE_APP_NODE_ENV=dev_sdtdt +# VUE_APP_NODE_ENV=dev #项目根路径 VUE_APP_PUBLIC_PATH=epmet-oper VUE_APP_CUSTOMER=yantai \ No newline at end of file diff --git a/src/utils/dai-map.js b/src/utils/dai-map.js index 0edd0fa9c..f51a46780 100644 --- a/src/utils/dai-map.js +++ b/src/utils/dai-map.js @@ -16,7 +16,7 @@ const urlSdtdt = (() => { }; } else { return { - search: "http://172.20.46.177/epmet-map-proxy/QueryService.ashx", + search: "http://172.20.46.177/map_search_proxy/search", geo: "http://172.20.46.177/epmet-map-proxy/GeoDecodeService.ashx", }; } @@ -108,12 +108,12 @@ export function searchNearby(map, keyword) { const center = map.getCenter(); const url = urlSdtdt.search; const { status, result } = await requestGet(url, { - // area: `CIRCLE(${center.lon} ${center.lat} 1000000)`, + area: `CIRCLE(${center.lon} ${center.lat} 1000000)`, words: keyword, city: "烟台", uid: "navinfo", st: "LocalSearch", - // tk: "e758167d5b90c351b70a979c0820840c", + tk: "e758167d5b90c351b70a979c0820840c", }); if ( diff --git a/src/utils/tdt-wp-zw.js b/src/utils/tdt-wp-zw.js index 8e2c609cb..55c57cf1c 100644 --- a/src/utils/tdt-wp-zw.js +++ b/src/utils/tdt-wp-zw.js @@ -1,6 +1,8 @@ -export const baseUrl = "http://59.206.203.34/tileservice/SDPubMap"; +// let vec = +// "http://59.206.203.34/tileservice/SDPubMap?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=sdvec&STYLE=default&TILEMATRIXSET=c&TILEMATRIX={z}&TILEROW={x}&TILECOL={y}&FORMAT=image%2Fpng"; + let vec = - "http://59.206.203.34/tileservice/SDPubMap?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=sdvec&STYLE=default&TILEMATRIXSET=c&TILEMATRIX={z}&TILEROW={x}&TILECOL={y}&FORMAT=image%2Fpng"; + "http://172.20.46.177/map_tile_proxy/appmaptile?lang=zh_cn&style=7<ype=7&scl=0&size=0&x={x}&y={y}&z={z}"; if (window.SITE_CONFIG["nodeEnv"] == "dev_sdtdt") { vec = "http://service.sdmap.gov.cn/tileservice/sdpubmap?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=sdvec&STYLE=default&TILEMATRIXSET=c&TILEMATRIX={z}&TILEROW={x}&TILECOL={y}&FORMAT=image%2Fpng&tk=e758167d5b90c351b70a979c0820840c"; diff --git a/src/views/modules/visual/command/cpts/map-ol.vue b/src/views/modules/visual/command/cpts/map-ol.vue index 0959d17f8..df446bf40 100644 --- a/src/views/modules/visual/command/cpts/map-ol.vue +++ b/src/views/modules/visual/command/cpts/map-ol.vue @@ -456,9 +456,11 @@ export default { target: "map", }); - myMap.on("singleclick", function (e) { - // console.log(e.coordinate) - // console.log(transform(e.coordinate, 'EPSG:3857', 'EPSG:4326')); + myMap.on("singleclick", (event) => { + myMap.forEachFeatureAtPixel(event.pixel, function (feature) { + // 为移动到的 feature 发送自定义的 mousemove 消息 + feature.dispatchEvent({ type: "click", event }); + }); }); await nextTick(); @@ -535,6 +537,21 @@ export default { }), ]; + item.on("click", function (event) { + console.log("我被点击拉", item, event); + // 修改feature的样式为半径100像素的园,用蓝色填充 + this.setStyle( + new ol.style.Style({ + image: new ol.style.Circle({ + radius: 100, + fill: new ol.style.Fill({ + color: "blue", + }), + }), + }) + ); + }); + setInterval(() => { let currStyle = item.getStyle(); if (!Array.isArray(currStyle)) { diff --git a/src/views/modules/visual/command/index.vue b/src/views/modules/visual/command/index.vue index fd33754a7..4a08c4291 100644 --- a/src/views/modules/visual/command/index.vue +++ b/src/views/modules/visual/command/index.vue @@ -288,7 +288,10 @@ export default { People, cptCard, ScreenLoading, - gridMap: mapType == "tdzw" ? gridMapOl : gridMap, + gridMap: + mapType == "tdzw" && SITE_CONFIG["nodeEnv"] == "dev_sdtdt" + ? gridMapOl + : gridMap, sidemenu1, sidemenu2, sidemenuLeft, diff --git a/src/views/modules/workSys/mapConfig.vue b/src/views/modules/workSys/mapConfig.vue index 96f209a03..939b9e36b 100644 --- a/src/views/modules/workSys/mapConfig.vue +++ b/src/views/modules/workSys/mapConfig.vue @@ -647,27 +647,27 @@ const vueGis = { gaodeMapLayer = new TileLayer({ title: "地图", - source: new XYZ({ - url: "http://t4.tianditu.com/DataServer?T=vec_w&tk=8a08c117ab9ee45d508686b01cc8d397&x={x}&y={y}&l={z}", - }), // source: new XYZ({ - // url: "http://api.tianditu.gov.cn/api?v=4.0&tk=c4dc987b442bd141a887d8d4a5d07926&x={x}&y={y}&l={z}" + // url: "http://t4.tianditu.com/DataServer?T=vec_w&tk=8a08c117ab9ee45d508686b01cc8d397&x={x}&y={y}&l={z}", // }), // source: new XYZ({ - // //指定url瓦片 - // url: 'http://wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=7&x={x}&y={y}&z={z}', - // wrapX: true//x方向平铺,也可以选择false + // url: "http://api.tianditu.gov.cn/api?v=4.0&tk=c4dc987b442bd141a887d8d4a5d07926&x={x}&y={y}&l={z}" // }), + source: new XYZ({ + //指定url瓦片 + url: "http://wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&style=7<ype=7&scl=0&size=0&x={x}&y={y}&z={z}", + wrapX: true, //x方向平铺,也可以选择false + }), // zIndex: 20 }); - var sourceMark = new XYZ({ - url: "http://t4.tianditu.com/DataServer?T=cva_w&tk=8a08c117ab9ee45d508686b01cc8d397&x={x}&y={y}&l={z}", - // zIndex: 22 - }); - var tileMark = new TileLayer({ - title: "标注图层", - source: sourceMark, - }); + // var sourceMark = new XYZ({ + // url: "http://t4.tianditu.com/DataServer?T=cva_w&tk=8a08c117ab9ee45d508686b01cc8d397&x={x}&y={y}&l={z}", + // // zIndex: 22 + // }); + // var tileMark = new TileLayer({ + // title: "标注图层", + // source: sourceMark, + // }); (mapView = new View({ //中心点坐标 @@ -680,7 +680,8 @@ const vueGis = { //初始化map和地图底图 //创建地图容器 (map = new Map({ - layers: [gaodeMapLayer, tileMark], + layers: [gaodeMapLayer], + // layers: [gaodeMapLayer, tileMark], //加载瓦片图层数据 view: mapView, target: "map",