Add animated orienteering course overlays and labels
This commit is contained in:
@@ -191,8 +191,10 @@ Page({
|
||||
|
||||
const canvasQuery = wx.createSelectorQuery().in(page)
|
||||
canvasQuery.select('#mapCanvas').fields({ node: true, size: true })
|
||||
canvasQuery.select('#routeLabelCanvas').fields({ node: true, size: true })
|
||||
canvasQuery.exec((canvasRes) => {
|
||||
const canvasRef = canvasRes[0] as any
|
||||
const labelCanvasRef = canvasRes[1] as any
|
||||
if (!canvasRef || !canvasRef.node) {
|
||||
page.setData({
|
||||
statusText: `WebGL 寮曟搸鍒濆鍖栧け璐?(${INTERNAL_BUILD_VERSION})`,
|
||||
@@ -202,7 +204,13 @@ Page({
|
||||
|
||||
const dpr = wx.getSystemInfoSync().pixelRatio || 1
|
||||
try {
|
||||
currentEngine.attachCanvas(canvasRef.node, rect.width, rect.height, dpr)
|
||||
currentEngine.attachCanvas(
|
||||
canvasRef.node,
|
||||
rect.width,
|
||||
rect.height,
|
||||
dpr,
|
||||
labelCanvasRef && labelCanvasRef.node ? labelCanvasRef.node : undefined,
|
||||
)
|
||||
} catch (error) {
|
||||
page.setData({
|
||||
statusText: `WebGL 鍒濆鍖栧け璐?(${INTERNAL_BUILD_VERSION})`,
|
||||
@@ -369,6 +377,8 @@ Page({
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user