index.html 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>测试Marker-ByPath</title>
  8. <script src="../libs/three.js"></script>
  9. <script src="../app/renderByPath.js"></script>
  10. <script src="../configByPath.js"></script>
  11. <link rel="stylesheet" href="../app/index.css">
  12. </head>
  13. <body>
  14. <div>Header <span id="info"></span></div>
  15. <div id="render-container" style="width: 960px; height: 540px"></div>
  16. <script>
  17. const infoEl = document.getElementById('info')
  18. const container = document.getElementById('render-container')
  19. const markerRender = new MarkerRenderByPath({
  20. container: container,
  21. config: config
  22. })
  23. markerRender.on('trackChanged', (trackId)=>{
  24. infoEl.textContent = `track: ${trackId}`
  25. })
  26. markerRender.on('markerClicked', (markerId)=>{
  27. console.log('click marker:', markerId)
  28. })
  29. </script>
  30. </body>
  31. </html>