| | |
| | | //openlayer 地图点击事件 |
| | | export function setClick(state) { |
| | | function handleClick(e) { |
| | | let coordinate = ol.proj.toLonLat(e.coordinate) |
| | | // console.log(coordinate, '地图点击') |
| | | store.setLayerPanelShow(false); |
| | | // 土地管理 |
| | | if (store.tdglInfo.flag) { |
| | |
| | | // "http://10.10.4.115:8022/geowinmap_xncs/ds?r=0.9158559377752831&serviceproviderid=map.vectorserviceprovider&serviceid=queryfeature&featcls=225%25E8%258C%2583%25E5%259B%25B4%25E5%2588%2586%25E5%258C%25BA%25E8%25A7%2584%25E5%2588%2592.geojson&lng=" + |
| | | window.gisBaseUrl + "BEApi/cs/geowinmap_xncs/ds?r=0.9158559377752831&serviceproviderid=map.vectorserviceprovider&serviceid=queryfeature&featcls=225%25E8%258C%2583%25E5%259B%25B4%25E5%2588%2586%25E5%258C%25BA%25E8%25A7%2584%25E5%2588%2592.geojson&lng=" + |
| | | // window.gisBaseUrl + "cs/geowinmap_xncs/ds?&lng=" + |
| | | e.coordinate[0] + |
| | | coordinate[0] + |
| | | "&lat=" + |
| | | e.coordinate[1] + |
| | | coordinate[1] + |
| | | "&geom=true&requesttype=json" |
| | | ).then(response => { |
| | | let center = { lon: 0, lat: 0 }; |
| | |
| | | zoom: 15, |
| | | duration: 1500 |
| | | }) |
| | | } |
| | | } |
| | | |
| | | //监听地图双击事件 |
| | | |
| | | export function touchClick() { |
| | | let dom = document.getElementById('openlayerContainer'); |
| | | dom.addEventListener('touchstart', onTouchStart); |
| | | function onTouchStart(e) { |
| | | let len = e.touches.length; |
| | | if (len === 2) { |
| | | window.mapapi.getView().animate({ |
| | | center: window.mapapi.getView().getCenter(), |
| | | zoom: window.mapapi.getView().getZoom() - 1, |
| | | duration: 1000, |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |