1234567891011121314151617181920212223242526272829303132 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>测试Marker-ByPath</title>
- <script src="../libs/three.js"></script>
- <script src="../app/renderByPath.js"></script>
- <script src="../configByPath.js"></script>
- <link rel="stylesheet" href="../app/index.css">
- </head>
- <body>
- <div>Header <span id="info"></span></div>
- <div id="render-container" style="width: 960px; height: 540px"></div>
- <script>
- const infoEl = document.getElementById('info')
- const container = document.getElementById('render-container')
- const markerRender = new MarkerRenderByPath({
- container: container,
- config: config
- })
- markerRender.on('trackChanged', (trackId)=>{
- infoEl.textContent = `track: ${trackId}`
- })
- markerRender.on('markerClicked', (markerId)=>{
- console.log('click marker:', markerId)
- })
- </script>
- </body>
- </html>
|