解决思路:获取点击区域的cartesian3(笛卡尔空间坐标),然后将其坐标赋给需要div的矢量数据

    1. // step1 添加一条管线
    2. const pipeLineLayer = new mars3d.layer.TilesetLayer({
    3. name: '一条管线',
    4. url: '一条管线的url'
    5. })
    6. map.addLayer(pipeLineLayer)
    7. // step2 监听管线点击事件
    8. pipeLineLayer.on(mars3d.EventType.click, e => {
    9. // step3 你可能需要获取到usID
    10. const usId = e.pickObject.getProperty('gw_id')
    11. // 获取到点击区域的笛卡尔空间坐标
    12. const cartesian3 = e.cartesian
    13. // step4 弹框
    14. const divGraphic = new mars3d.graphic.DivGraphic({
    15. pointerEvents: true,
    16. position: cartesian3, // 赋值
    17. style: {
    18. .....
    19. }
    20. })
    21. })