|
|
|
@ -21,16 +21,16 @@ export const setInitMapAndMallInfo = async function () { |
|
|
|
})) |
|
|
|
//初始化地图
|
|
|
|
onReady(currentFloor.data as Map, () => { |
|
|
|
const facilityList = (window as any).Map_QM.getAllIcon().flat(Infinity) |
|
|
|
const facilityList = window.Map_QM.getAllIcon().flat(Infinity) |
|
|
|
|
|
|
|
const list = facilityList.map((item: { imgUrl: string }) => { |
|
|
|
item.imgUrl.replace('./', '/') |
|
|
|
return item |
|
|
|
}) |
|
|
|
;(window as any).Map_QM.addEventListener('shop', onClickShop, false) |
|
|
|
window.Map_QM.addEventListener('shop', onClickShop, false) |
|
|
|
|
|
|
|
store.SET_FACILITY_LIST(uniqBy(list, 'type')) |
|
|
|
;(window as any).Map_QM.renderer.domElement.addEventListener('webglcontextlost', onContextLost) |
|
|
|
window.Map_QM.renderer.domElement.addEventListener('webglcontextlost', onContextLost) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
@ -40,11 +40,11 @@ function onClickShop(event: { data: { shopName: string; xaxis: any; yaxis: any; |
|
|
|
const store = useStore() |
|
|
|
showMapDialog() |
|
|
|
;(document.getElementById('shopNum') as HTMLElement).innerText = event.data.shopName |
|
|
|
;(window as any).Map_QM.addElementLabel(document.getElementById('shopInfo'), event.data.xaxis, event.data.yaxis) |
|
|
|
window.Map_QM.addElementLabel(document.getElementById('shopInfo'), event.data.xaxis, event.data.yaxis) |
|
|
|
store.SET_SHOP(event.data.shopData) |
|
|
|
} else { |
|
|
|
hideMapDialog() |
|
|
|
;(window as any).Map_QM.cancelSelectShop() |
|
|
|
window.Map_QM.cancelSelectShop() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -60,7 +60,7 @@ function showMapDialog() { |
|
|
|
|
|
|
|
//地图初始化
|
|
|
|
function onReady({ floorOrder, yaxis, angle }: Map, callback: () => void) { |
|
|
|
;(window as any).Config.getInstance(callback, 0, floorOrder, yaxis, angle) //设备楼栋, 设备楼层, 点位(机器点位直连主干道而不在主干道上), 方向 84 85
|
|
|
|
window.Config.getInstance(callback, 0, floorOrder, yaxis, angle) //设备楼栋, 设备楼层, 点位(机器点位直连主干道而不在主干道上), 方向 84 85
|
|
|
|
} |
|
|
|
|
|
|
|
//监听地图上下文丢失 刷新页面
|
|
|
|
|