| | |
| | | }, |
| | | }); |
| | | window.map.addOverlay(overlay); |
| | | |
| | | // let _clickCallback = callback; |
| | | function handleClick(e) { |
| | | console.log(e.coordinate); |
| | | // 土地管理 |
| | |
| | | rjl, |
| | | jzxg, |
| | | jzmd, |
| | | lon:e.coordinate[0], |
| | | lon: e.coordinate[0], |
| | | lat: e.coordinate[1], |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | window.map.forEachFeatureAtPixel(e.pixel, function (feature) { |
| | | // console.log(feature, '111111') |
| | | if (feature && feature.values_.desc) { |
| | | ponitPanel.style.display = 'block' |
| | | |
| | | let obj = feature.values_.desc |
| | | objdata = { |
| | | POITYPE: "POINT", |
| | |
| | | lon: obj.lng, |
| | | lat: obj.lat |
| | | } |
| | | |
| | | |
| | | ponitPanel.innerHTML = ` |
| | | <div class="ponitPanel-name"> |
| | | <span>名称:</span> |
| | | <span>${objdata.name}</span> |
| | | </div> |
| | | <div class="ponitPanel-value"> |
| | | <span>地址:</span> |
| | | <span>${objdata.address}</span> |
| | | </div>` |
| | | |
| | | setTimeout(() => { |
| | | overlay.setPosition(e.coordinate); |
| | | }, 0) |
| | | |
| | | // store.setPoplayerShowAction(true); |
| | | // store.setPoplayerListAction(objdata); |
| | | // if (window.instance) { |
| | | // window.instance.$destroy(); |
| | | // } |
| | | // window.instance = new PoiLayerConstructor({ |
| | | // data: { |
| | | // list: objdata |
| | | // } |
| | | // }); |
| | | // window.instance.$mount(); |
| | | console.log('objdata'); |
| | | store.setPoplayerShowAction(true); |
| | | store.setPoplayerListAction(objdata); |
| | | window.instance = new PoiLayerConstructor({ |
| | | data: { |
| | | list1: objdata |
| | | } |
| | | }); |
| | | window.instance.$mount(); |
| | | } |
| | | }); |
| | | } |
| | |
| | | |
| | | |
| | | export function flyToPoint(posisitons) { |
| | | // let zoom = window.map.getView().getZoom(); |
| | | // if (zoom >= 16) { |
| | | // zoom = 12 |
| | | // } |
| | | // let duration = 2000; |
| | | window.map.getView().animate({ |
| | | center: posisitons, |
| | | zoom: 12, |
| | | zoom: 15, |
| | | duration: 1500 |
| | | }) |
| | | // window.map.getView().animate( |
| | | // //动画开始时 |
| | | // { |
| | | // zoom: zoom > 16 ? zoom - 0.01 : zoom + 0.01, |
| | | // duration: duration / 2, |
| | | // }, |
| | | // //动画结束时 |
| | | // { |
| | | // zoom: zoom >= 16 ? 16 : zoom + 4, |
| | | // duration: duration / 2, |
| | | // } |
| | | // ); |
| | | } |