yi-map-web 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +184 -0
- package/dist/App.vue.d.ts +2 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_0.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_1.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_10.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_11.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_12.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_13.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_14.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_15.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_16.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_17.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_18.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_19.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_2.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_20.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_21.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_22.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_23.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_24.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_25.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_26.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_27.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_3.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_4.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_5.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_6.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_7.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_8.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/IAU2006_XYS/IAU2006_XYS_9.json +1 -0
- package/dist/assets/mars3d-cesium/Assets/Images/bing_maps_credit.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Images/cesium_credit.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Images/google_earth_credit.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Images/ion-credit.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml +14 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/airfield.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/airport.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/alcohol-shop.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/america-football.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/art-gallery.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/bakery.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/bank.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/bar.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/baseball.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/basketball.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/beer.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/bicycle.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/building.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/bus.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/cafe.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/camera.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/campsite.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/car.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/cemetery.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/cesium.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/chemist.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/cinema.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/circle-stroked.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/circle.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/city.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/clothing-store.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/college.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/commercial.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/cricket.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/cross.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/dam.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/danger.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/disability.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/dog-park.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/embassy.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/emergency-telephone.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/entrance.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/farm.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/fast-food.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/ferry.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/fire-station.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/fuel.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/garden.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/gift.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/golf.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/grocery.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/hairdresser.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/harbor.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/heart.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/heliport.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/hospital.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/ice-cream.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/industrial.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/land-use.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/laundry.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/library.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/lighthouse.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/lodging.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/logging.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/london-underground.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/marker-stroked.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/marker.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/minefield.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/mobilephone.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/monument.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/museum.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/music.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/oil-well.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/park.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/park2.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/parking-garage.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/parking.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/pharmacy.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/pitch.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/place-of-worship.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/playground.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/police.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/polling-place.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/post.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/prison.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/rail-above.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/rail-light.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/rail-metro.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/rail-underground.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/rail.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/religious-christian.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/religious-jewish.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/religious-muslim.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/restaurant.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/roadblock.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/rocket.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/school.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/scooter.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/shop.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/skiing.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/slaughterhouse.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/soccer.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/square-stroked.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/square.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/star-stroked.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/star.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/suitcase.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/swimming.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/telephone.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/tennis.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/theatre.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/toilets.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/town-hall.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/town.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/triangle-stroked.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/triangle.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/village.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/warehouse.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/waste-basket.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/water.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/wetland.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/maki/zoo.png +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/moonSmall.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/pin.svg +1 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/waterNormals.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/Textures/waterNormalsSmall.jpg +0 -0
- package/dist/assets/mars3d-cesium/Assets/approximateTerrainHeights.json +1 -0
- package/dist/assets/mars3d-cesium/Cesium.js +17126 -0
- package/dist/assets/mars3d-cesium/ThirdParty/Workers/package.json +1 -0
- package/dist/assets/mars3d-cesium/ThirdParty/Workers/z-worker-pako.js +1 -0
- package/dist/assets/mars3d-cesium/ThirdParty/basis_transcoder.wasm +0 -0
- package/dist/assets/mars3d-cesium/ThirdParty/draco_decoder.wasm +0 -0
- package/dist/assets/mars3d-cesium/ThirdParty/google-earth-dbroot-parser.js +1 -0
- package/dist/assets/mars3d-cesium/ThirdParty/wasm_splats_bg.wasm +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Animation/Animation.css +127 -0
- package/dist/assets/mars3d-cesium/Widgets/Animation/lighter.css +70 -0
- package/dist/assets/mars3d-cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css +108 -0
- package/dist/assets/mars3d-cesium/Widgets/BaseLayerPicker/lighter.css +22 -0
- package/dist/assets/mars3d-cesium/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css +102 -0
- package/dist/assets/mars3d-cesium/Widgets/CesiumInspector/CesiumInspector.css +113 -0
- package/dist/assets/mars3d-cesium/Widgets/CesiumWidget/CesiumWidget.css +119 -0
- package/dist/assets/mars3d-cesium/Widgets/CesiumWidget/lighter.css +14 -0
- package/dist/assets/mars3d-cesium/Widgets/FullscreenButton/FullscreenButton.css +8 -0
- package/dist/assets/mars3d-cesium/Widgets/Geocoder/Geocoder.css +70 -0
- package/dist/assets/mars3d-cesium/Widgets/Geocoder/lighter.css +17 -0
- package/dist/assets/mars3d-cesium/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css +27 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/ImageryProviders/azureAerial.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/ImageryProviders/azureRoads.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/ImageryProviders/bingAerial.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/ImageryProviders/bingAerialLabels.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/ImageryProviders/bingRoads.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/ImageryProviders/blueMarble.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/ImageryProviders/earthAtNight.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/ImageryProviders/googleContour.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/ImageryProviders/googleRoadmap.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/ImageryProviders/googleSatellite.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/ImageryProviders/googleSatelliteLabels.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/ImageryProviders/mapboxSatellite.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/ImageryProviders/mapboxStreets.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/ImageryProviders/mapboxTerrain.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/ImageryProviders/naturalEarthII.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/ImageryProviders/openStreetMap.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/ImageryProviders/sentinel-2.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/ImageryProviders/stamenToner.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/ImageryProviders/stamenWatercolor.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/NavigationHelp/Mouse.svg +84 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/NavigationHelp/MouseLeft.svg +76 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/NavigationHelp/MouseMiddle.svg +76 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/NavigationHelp/MouseRight.svg +76 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/NavigationHelp/Touch.svg +120 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/NavigationHelp/TouchDrag.svg +129 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/NavigationHelp/TouchRotate.svg +76 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/NavigationHelp/TouchTilt.svg +135 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/NavigationHelp/TouchZoom.svg +74 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/TerrainProviders/CesiumWorldTerrain.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/TerrainProviders/Ellipsoid.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/TimelineIcons.png +0 -0
- package/dist/assets/mars3d-cesium/Widgets/Images/info-loading.gif +0 -0
- package/dist/assets/mars3d-cesium/Widgets/InfoBox/InfoBox.css +92 -0
- package/dist/assets/mars3d-cesium/Widgets/InfoBox/InfoBoxDescription.css +178 -0
- package/dist/assets/mars3d-cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css +93 -0
- package/dist/assets/mars3d-cesium/Widgets/NavigationHelpButton/lighter.css +38 -0
- package/dist/assets/mars3d-cesium/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +15 -0
- package/dist/assets/mars3d-cesium/Widgets/ProjectionPicker/ProjectionPicker.css +38 -0
- package/dist/assets/mars3d-cesium/Widgets/SceneModePicker/SceneModePicker.css +56 -0
- package/dist/assets/mars3d-cesium/Widgets/SelectionIndicator/SelectionIndicator.css +20 -0
- package/dist/assets/mars3d-cesium/Widgets/Timeline/Timeline.css +103 -0
- package/dist/assets/mars3d-cesium/Widgets/Timeline/lighter.css +23 -0
- package/dist/assets/mars3d-cesium/Widgets/VRButton/VRButton.css +8 -0
- package/dist/assets/mars3d-cesium/Widgets/Viewer/Viewer.css +107 -0
- package/dist/assets/mars3d-cesium/Widgets/VoxelInspector/VoxelInspector.css +16 -0
- package/dist/assets/mars3d-cesium/Widgets/lighter.css +237 -0
- package/dist/assets/mars3d-cesium/Widgets/lighterShared.css +46 -0
- package/dist/assets/mars3d-cesium/Widgets/shared.css +103 -0
- package/dist/assets/mars3d-cesium/Widgets/widgets.css +1342 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-336QMGTQ.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-3BFV72N7.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-422SYBQS.js +27 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-4FULWVRZ.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-5IQULCCZ.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-5JMVLL6X.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-65MI2E3A.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-7SZRKGJD.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-7U5EVTKW.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-AXIQD4JA.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-AZSS2BNB.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-BYYYB2C7.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-C6HKNYGW.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-DMJB4DHC.js +29 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-ECLCX5XZ.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-FHECC5EZ.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-GDJPERBD.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-GLZ7AVHY.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-GVEYCBKG.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-HNKLZQOV.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-II4OPXPA.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-ILTEXGHO.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-JD76ATDQ.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-JQWGTP3K.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-K35RPNUR.js +27 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-KIXGV6RH.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-LT7NKOZD.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-LUCUOT65.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-MWY74K7V.js +63 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-N6SIW7ZL.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-NL753UYH.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-OVOY7YA7.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-PQWMNK6M.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-PUOAX5MA.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-PUPGLHXG.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-PXZYU6PD.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-Q6MK2R6B.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-Q6YG52WP.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-QQJ4EFK2.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-RPFEAA52.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-RTRJ3LVQ.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-SDQXNLTQ.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-TJ6QLJOT.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-TJUBNZ45.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-TOK3PZ73.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-UKJ254OV.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-VC43NA4S.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-WPXTUJZY.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-WRLXLKCG.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-WYMSHGR6.js +28 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-X56SSSS5.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-XXWWJ3QU.js +28 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-YBIGLQJN.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-YDQLCOZM.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-YECQFZBX.js +29 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-YWNU5ZQD.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/chunk-Z4E6T4NK.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/combineGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createBoxGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createBoxOutlineGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createCircleGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createCircleOutlineGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createCoplanarPolygonGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createCoplanarPolygonOutlineGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createCorridorGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createCorridorOutlineGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createCylinderGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createCylinderOutlineGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createEllipseGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createEllipseOutlineGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createEllipsoidGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createEllipsoidOutlineGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createFrustumGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createFrustumOutlineGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createGroundPolylineGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createPlaneGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createPlaneOutlineGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createPolygonGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createPolygonOutlineGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createPolylineGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createPolylineVolumeGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createPolylineVolumeOutlineGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createRectangleGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createRectangleOutlineGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createSimplePolylineGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createSphereGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createSphereOutlineGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createTaskProcessorWorker.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createVectorTileClampedPolylines.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createVectorTileGeometries.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createVectorTilePoints.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createVectorTilePolygons.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createVectorTilePolylines.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createVerticesFromCesium3DTilesTerrain.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createVerticesFromHeightmap.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createWallGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/createWallOutlineGeometry.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/decodeDraco.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/decodeGoogleEarthEnterprisePacket.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/decodeI3S.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/gaussianSplatSorter.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/gaussianSplatTextureGenerator.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/incrementallyBuildTerrainPicker.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/transcodeKTX2.js +56 -0
- package/dist/assets/mars3d-cesium/Workers/transferTypedArrayTest.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/upsampleQuantizedTerrainMesh.js +26 -0
- package/dist/assets/mars3d-cesium/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +26 -0
- package/dist/components/business/index.d.ts +13 -0
- package/dist/components/business/poi-marker/PoiMarkerPanel.vue.d.ts +2 -0
- package/dist/components/business/poi-marker/usePoiMarker.d.ts +46 -0
- package/dist/components/business/track/TrackPanel.vue.d.ts +2 -0
- package/dist/components/business/track/useTrack.d.ts +84 -0
- package/dist/components/mars-map/composables/useDraw.d.ts +15 -0
- package/dist/components/mars-map/composables/useMap.d.ts +29 -0
- package/dist/components/mars-map/composables/useMeasure.d.ts +11 -0
- package/dist/components/mars-map/composables/useVision.d.ts +11 -0
- package/dist/components/mars-map/index.d.ts +15 -0
- package/dist/components/mars-map/panels/ToolbarPanel.vue.d.ts +21 -0
- package/dist/components/mars-map/panels/VisionPanel.vue.d.ts +25 -0
- package/dist/components/mars-work/mars-map.vue.d.ts +44 -0
- package/dist/config/config copy.json +1488 -0
- package/dist/config/config.json +1298 -0
- package/dist/favicon.ico +0 -0
- package/dist/img/basemaps/TerrainEllipsoid.png +0 -0
- package/dist/img/basemaps/TerrainSTK.png +0 -0
- package/dist/img/basemaps/arcgis.png +0 -0
- package/dist/img/basemaps/bd-c-bluish.png +0 -0
- package/dist/img/basemaps/bd-c-dark.png +0 -0
- package/dist/img/basemaps/bd-c-darkgreen.png +0 -0
- package/dist/img/basemaps/bd-c-googlelite.png +0 -0
- package/dist/img/basemaps/bd-c-grassgreen.png +0 -0
- package/dist/img/basemaps/bd-c-grayscale.png +0 -0
- package/dist/img/basemaps/bd-c-hardedge.png +0 -0
- package/dist/img/basemaps/bd-c-light.png +0 -0
- package/dist/img/basemaps/bd-c-midnight.png +0 -0
- package/dist/img/basemaps/bd-c-pink.png +0 -0
- package/dist/img/basemaps/bd-c-redalert.png +0 -0
- package/dist/img/basemaps/bd-img.png +0 -0
- package/dist/img/basemaps/bd-vec.png +0 -0
- package/dist/img/basemaps/bingAerial.png +0 -0
- package/dist/img/basemaps/bingAerialLabels.png +0 -0
- package/dist/img/basemaps/bingRoads.png +0 -0
- package/dist/img/basemaps/bingimage.png +0 -0
- package/dist/img/basemaps/bingmap.png +0 -0
- package/dist/img/basemaps/blackMarble.png +0 -0
- package/dist/img/basemaps/esriNationalGeographic.png +0 -0
- package/dist/img/basemaps/esriWorldImagery.png +0 -0
- package/dist/img/basemaps/esriWorldStreetMap.png +0 -0
- package/dist/img/basemaps/gaode_img.png +0 -0
- package/dist/img/basemaps/gaode_vec.png +0 -0
- package/dist/img/basemaps/google_img.png +0 -0
- package/dist/img/basemaps/google_ter.png +0 -0
- package/dist/img/basemaps/google_vec.png +0 -0
- package/dist/img/basemaps/mapQuestOpenStreetMap.png +0 -0
- package/dist/img/basemaps/mapboxSatellite.png +0 -0
- package/dist/img/basemaps/mapboxStreets.png +0 -0
- package/dist/img/basemaps/mapboxTerrain.png +0 -0
- package/dist/img/basemaps/naturalEarthII.png +0 -0
- package/dist/img/basemaps/offline.png +0 -0
- package/dist/img/basemaps/osm.png +0 -0
- package/dist/img/basemaps/sea.png +0 -0
- package/dist/img/basemaps/stamenToner.png +0 -0
- package/dist/img/basemaps/stamenWatercolor.png +0 -0
- package/dist/img/basemaps/tdt_img.png +0 -0
- package/dist/img/basemaps/tdt_ter.png +0 -0
- package/dist/img/basemaps/tdt_vec.png +0 -0
- package/dist/img/basemaps/tencent_img.png +0 -0
- package/dist/img/basemaps/tencent_vec.png +0 -0
- package/dist/img/marker/mark-blue.png +0 -0
- package/dist/img/textures/fence.png +0 -0
- package/dist/img/textures/poly-rivers.png +0 -0
- package/dist/img/textures/waterNormals.jpg +0 -0
- package/dist/index.d.ts +41 -0
- package/dist/main.d.ts +4 -0
- package/dist/style.css +4295 -0
- package/dist/yi-map-web.mjs +2107 -0
- package/dist/yi-map-web.mjs.map +1 -0
- package/dist/yi-map-web.umd.cjs +2128 -0
- package/dist/yi-map-web.umd.cjs.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1,2107 @@
|
|
|
1
|
+
import { defineComponent, computed, onMounted, onUnmounted, openBlock, createElementBlock, toRaw, ref, normalizeClass, createElementVNode, withDirectives, Fragment, renderList, vShow, createVNode, Transition, withCtx, toDisplayString, createCommentVNode, shallowRef, provide, createBlock, unref, renderSlot, inject, watch, reactive, normalizeStyle, withModifiers, createTextVNode, TransitionGroup, withKeys, vModelText } from "vue";
|
|
2
|
+
import * as mars3d from "mars3d";
|
|
3
|
+
class CameraList extends mars3d.TaskItem {
|
|
4
|
+
// 进入,激活开始处理事务
|
|
5
|
+
_activateWork() {
|
|
6
|
+
this._map.setCameraViewList(this.options.list);
|
|
7
|
+
}
|
|
8
|
+
// 暂停(非必须)
|
|
9
|
+
_pauseWork() {
|
|
10
|
+
this._disableWork();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
mars3d.thing.Task.register("cameraList", CameraList);
|
|
14
|
+
class CameraView extends mars3d.TaskItem {
|
|
15
|
+
// 进入,激活开始处理事务
|
|
16
|
+
_activateWork() {
|
|
17
|
+
this._map.setCameraView(this.options.center, { duration: this._duration });
|
|
18
|
+
}
|
|
19
|
+
// 离开,释放相关对象
|
|
20
|
+
_disableWork() {
|
|
21
|
+
this._map.cancelFlyTo();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
mars3d.thing.Task.register("camera", CameraView);
|
|
25
|
+
class MapRotate extends mars3d.TaskItem {
|
|
26
|
+
constructor(options = {}) {
|
|
27
|
+
super(options);
|
|
28
|
+
this._speed = this.options.speed || 0.01;
|
|
29
|
+
this._center = this.options.center || { lat: 29.093038, lng: 108.804459, alt: 233212327e-1, heading: 0, pitch: -90 };
|
|
30
|
+
}
|
|
31
|
+
// 进入,激活开始处理事务
|
|
32
|
+
_activateWork() {
|
|
33
|
+
this._map.setCameraView(this._center, {
|
|
34
|
+
duration: 1,
|
|
35
|
+
complete: () => {
|
|
36
|
+
this._map.on(mars3d.EventType.clockTick, this._map_onClockTick, this);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
// 离开,释放相关对象
|
|
41
|
+
_disableWork() {
|
|
42
|
+
this._map.off(mars3d.EventType.clockTick, this._map_onClockTick, this);
|
|
43
|
+
}
|
|
44
|
+
_map_onClockTick() {
|
|
45
|
+
if (this.isPause) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
this._map.scene.camera.rotate(mars3d.Cesium.Cartesian3.UNIT_Z, this._speed);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
mars3d.thing.Task.register("mapRotate", MapRotate);
|
|
52
|
+
class PointRotate extends mars3d.TaskItem {
|
|
53
|
+
// 进入,激活开始处理事务
|
|
54
|
+
_activateWork() {
|
|
55
|
+
if (this.options.center) {
|
|
56
|
+
this._map.setCameraView(this.options.center, { duration: 0 });
|
|
57
|
+
}
|
|
58
|
+
if (this.options.autoStop) {
|
|
59
|
+
delete this.options.autoStopAngle;
|
|
60
|
+
}
|
|
61
|
+
if (this.options.isRotateOut) {
|
|
62
|
+
this._rotateOut = new mars3d.thing.RotateOut(this.options);
|
|
63
|
+
this._map.addThing(this._rotateOut);
|
|
64
|
+
} else {
|
|
65
|
+
this._rotatePoint = new mars3d.thing.RotatePoint(this.options);
|
|
66
|
+
this._map.addThing(this._rotatePoint);
|
|
67
|
+
}
|
|
68
|
+
if (this.options.isRotateOut) {
|
|
69
|
+
this._rotateOut.start();
|
|
70
|
+
} else {
|
|
71
|
+
this._rotatePoint.start(this.options.point);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// 离开,释放相关对象
|
|
75
|
+
_disableWork() {
|
|
76
|
+
if (this._rotatePoint) {
|
|
77
|
+
this._rotatePoint.stop();
|
|
78
|
+
this._rotatePoint.destroy();
|
|
79
|
+
delete this._rotatePoint;
|
|
80
|
+
}
|
|
81
|
+
if (this._rotateOut) {
|
|
82
|
+
this._rotateOut.stop();
|
|
83
|
+
this._rotateOut.destroy();
|
|
84
|
+
delete this._rotateOut;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
mars3d.thing.Task.register("pointRotate", PointRotate);
|
|
89
|
+
class RouteLine extends mars3d.TaskItem {
|
|
90
|
+
// constructor(options) {
|
|
91
|
+
// super(options)
|
|
92
|
+
// }
|
|
93
|
+
// 进入,激活开始处理事务
|
|
94
|
+
_activateWork() {
|
|
95
|
+
this._graphicLayer = new mars3d.layer.GraphicLayer();
|
|
96
|
+
this._map.addLayer(this._graphicLayer);
|
|
97
|
+
const fixedRoute = new mars3d.graphic.FixedRoute(this.options.route);
|
|
98
|
+
this._graphicLayer.addGraphic(fixedRoute);
|
|
99
|
+
this._fixedRoute = fixedRoute;
|
|
100
|
+
fixedRoute.start();
|
|
101
|
+
}
|
|
102
|
+
// 暂停(非必须)
|
|
103
|
+
_pauseWork(options) {
|
|
104
|
+
if (this._fixedRoute) {
|
|
105
|
+
this._fixedRoute.pause();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// 继续(非必须)
|
|
109
|
+
_proceedWork() {
|
|
110
|
+
if (this._fixedRoute) {
|
|
111
|
+
this._fixedRoute.proceed();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
// 离开,释放相关对象
|
|
115
|
+
_disableWork() {
|
|
116
|
+
if (this._fixedRoute) {
|
|
117
|
+
this._fixedRoute.stop();
|
|
118
|
+
delete this._fixedRoute;
|
|
119
|
+
}
|
|
120
|
+
if (this._graphicLayer) {
|
|
121
|
+
this._graphicLayer.destroy();
|
|
122
|
+
delete this._graphicLayer;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
mars3d.thing.Task.register("routeLine", RouteLine);
|
|
127
|
+
class ZoomIn extends mars3d.TaskItem {
|
|
128
|
+
// 进入,激活开始处理事务
|
|
129
|
+
_activateWork() {
|
|
130
|
+
this._map.zoomIn(this.options.relativeAmount);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
mars3d.thing.Task.register("zoomIn", ZoomIn);
|
|
134
|
+
class ZoomOut extends mars3d.TaskItem {
|
|
135
|
+
// 进入,激活开始处理事务
|
|
136
|
+
_activateWork() {
|
|
137
|
+
this._map.zoomOut(this.options.relativeAmount);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
mars3d.thing.Task.register("zoomOut", ZoomOut);
|
|
141
|
+
class FlickerEntity extends mars3d.TaskItem {
|
|
142
|
+
// 进入,激活开始处理事务
|
|
143
|
+
_activateWork() {
|
|
144
|
+
const layer = this._map.getLayerById(this.options.layerId);
|
|
145
|
+
if (layer) {
|
|
146
|
+
layer.show = true;
|
|
147
|
+
layer.readyPromise.then(() => {
|
|
148
|
+
this._graphic = layer.getGraphicById(this.options.graphicId);
|
|
149
|
+
if (this._graphic) {
|
|
150
|
+
this._graphic.show = true;
|
|
151
|
+
this._graphic.startFlicker({
|
|
152
|
+
time: this._duration,
|
|
153
|
+
step: this.options.step,
|
|
154
|
+
maxAlpha: this.options.maxAlpha,
|
|
155
|
+
color: this.options.color
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
// 离开,释放相关对象
|
|
162
|
+
_disableWork() {
|
|
163
|
+
if (this._graphic) {
|
|
164
|
+
this._graphic.stopFlicker();
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
mars3d.thing.Task.register("flickerEntity", FlickerEntity);
|
|
169
|
+
class CanvasBillboard extends mars3d.graphic.BillboardPrimitive {
|
|
170
|
+
/**
|
|
171
|
+
* 文字
|
|
172
|
+
* @type {string}
|
|
173
|
+
*/
|
|
174
|
+
get text() {
|
|
175
|
+
return this.style.text;
|
|
176
|
+
}
|
|
177
|
+
set text(val) {
|
|
178
|
+
this.style.text = val;
|
|
179
|
+
this.label.text = val;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* 对象添加到图层前创建一些对象的钩子方法,
|
|
183
|
+
* 只会调用一次
|
|
184
|
+
* @return {Promise<object>} 无
|
|
185
|
+
* @private
|
|
186
|
+
*/
|
|
187
|
+
_addedHook(style) {
|
|
188
|
+
style.image = "//data.mars3d.cn/img/marker/bg/textPnl.png";
|
|
189
|
+
style.label = {
|
|
190
|
+
...style,
|
|
191
|
+
text: this.style.text,
|
|
192
|
+
font_size: 55,
|
|
193
|
+
color: style.textColor ?? "#ffffff",
|
|
194
|
+
hasPixelOffset: true,
|
|
195
|
+
pixelOffsetX: 0,
|
|
196
|
+
pixelOffsetY: -36 * (style.scale ?? 1)
|
|
197
|
+
};
|
|
198
|
+
if (style.scaleByDistance) {
|
|
199
|
+
style.label.pixelOffsetScaleByDistance = style.scaleByDistance;
|
|
200
|
+
}
|
|
201
|
+
super._addedHook(style);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
mars3d.GraphicUtil.register("canvasBillboard", CanvasBillboard);
|
|
205
|
+
const _hoisted_1$5 = ["id"];
|
|
206
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
207
|
+
__name: "mars-map",
|
|
208
|
+
props: {
|
|
209
|
+
mapKey: { default: "default" },
|
|
210
|
+
url: { default: void 0 },
|
|
211
|
+
options: { default: void 0 }
|
|
212
|
+
},
|
|
213
|
+
emits: ["onload"],
|
|
214
|
+
setup(__props, { emit: __emit }) {
|
|
215
|
+
const props = __props;
|
|
216
|
+
let map;
|
|
217
|
+
const withKeyId = computed(() => `mars3d-container-${props.mapKey}`);
|
|
218
|
+
const emit = __emit;
|
|
219
|
+
const initMars3d = async () => {
|
|
220
|
+
let mapOptions;
|
|
221
|
+
if (props.url) {
|
|
222
|
+
mapOptions = await mars3d.Util.fetchJson({ url: props.url });
|
|
223
|
+
if (props.options) {
|
|
224
|
+
mapOptions = mars3d.Util.merge(mapOptions, toRaw(props.options));
|
|
225
|
+
}
|
|
226
|
+
} else if (props.options) {
|
|
227
|
+
mapOptions = toRaw(props.options);
|
|
228
|
+
}
|
|
229
|
+
mars3d.Util.showCopyright = false;
|
|
230
|
+
map = new mars3d.Map(withKeyId.value, mapOptions);
|
|
231
|
+
if (mars3d.Util.isPCBroswer()) {
|
|
232
|
+
map.zoomFactor = 2;
|
|
233
|
+
if (window.navigator.userAgent.toLowerCase().indexOf("msie") >= 0) {
|
|
234
|
+
map.viewer.targetFrameRate = 20;
|
|
235
|
+
map.scene.requestRenderMode = false;
|
|
236
|
+
}
|
|
237
|
+
} else {
|
|
238
|
+
map.zoomFactor = 5;
|
|
239
|
+
map.scene.requestRenderMode = false;
|
|
240
|
+
map.scene.fog.enabled = false;
|
|
241
|
+
map.scene.skyAtmosphere.show = false;
|
|
242
|
+
map.scene.globe.showGroundAtmosphere = false;
|
|
243
|
+
}
|
|
244
|
+
if (map.viewer.sceneModePicker) {
|
|
245
|
+
map.viewer.sceneModePicker.viewModel.duration = 0;
|
|
246
|
+
}
|
|
247
|
+
if (map.mars3dLogo) {
|
|
248
|
+
map.mars3dLogo.show = false;
|
|
249
|
+
}
|
|
250
|
+
setTimeout(() => {
|
|
251
|
+
const logoElements = document.getElementsByClassName("mars3d-logo");
|
|
252
|
+
for (let i = 0; i < logoElements.length; i++) {
|
|
253
|
+
logoElements[i].remove();
|
|
254
|
+
}
|
|
255
|
+
}, 100);
|
|
256
|
+
emit("onload", map);
|
|
257
|
+
};
|
|
258
|
+
onMounted(() => {
|
|
259
|
+
initMars3d();
|
|
260
|
+
});
|
|
261
|
+
onUnmounted(() => {
|
|
262
|
+
if (map) {
|
|
263
|
+
map.destroy();
|
|
264
|
+
map = null;
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
return (_ctx, _cache) => {
|
|
268
|
+
return openBlock(), createElementBlock("div", {
|
|
269
|
+
id: withKeyId.value,
|
|
270
|
+
class: "mars3d-container"
|
|
271
|
+
}, null, 8, _hoisted_1$5);
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
const _hoisted_1$4 = { class: "panel-content" };
|
|
276
|
+
const _hoisted_2$3 = { class: "menu-group" };
|
|
277
|
+
const _hoisted_3$3 = ["title", "onClick"];
|
|
278
|
+
const _hoisted_4$3 = { class: "menu-group" };
|
|
279
|
+
const _hoisted_5$2 = ["title", "onClick"];
|
|
280
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
281
|
+
__name: "ToolbarPanel",
|
|
282
|
+
props: {
|
|
283
|
+
activeDrawType: {}
|
|
284
|
+
},
|
|
285
|
+
emits: ["toolActivate", "clear"],
|
|
286
|
+
setup(__props, { emit: __emit }) {
|
|
287
|
+
const emit = __emit;
|
|
288
|
+
const isCollapsed = ref(false);
|
|
289
|
+
const toggleCollapse = () => {
|
|
290
|
+
isCollapsed.value = !isCollapsed.value;
|
|
291
|
+
};
|
|
292
|
+
const activateTool = (tool) => {
|
|
293
|
+
emit("toolActivate", tool);
|
|
294
|
+
};
|
|
295
|
+
const emitClear = () => {
|
|
296
|
+
emit("clear");
|
|
297
|
+
};
|
|
298
|
+
const measureTools = [
|
|
299
|
+
{
|
|
300
|
+
tool: "measureDistance",
|
|
301
|
+
title: "测量距离",
|
|
302
|
+
iconClasses: ["fa", "fa-arrows-alt-h"]
|
|
303
|
+
// 水平双向箭头,更准确表达距离
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
tool: "measureArea",
|
|
307
|
+
title: "测量面积",
|
|
308
|
+
iconClasses: ["fa", "fa-vector-square"]
|
|
309
|
+
// 矢量方块,更几何感、专业感
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
tool: "measureHeight",
|
|
313
|
+
title: "测量高度差",
|
|
314
|
+
iconClasses: ["fa", "fa-arrows-alt-v"]
|
|
315
|
+
// 垂直双向箭头,清晰表达高度
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
tool: "measureAngle",
|
|
319
|
+
title: "测量角度",
|
|
320
|
+
iconClasses: ["fa-solid", "fa-compass-drafting"]
|
|
321
|
+
// 绘图圆规图标,专业表达角度测量
|
|
322
|
+
}
|
|
323
|
+
];
|
|
324
|
+
const drawTools = [
|
|
325
|
+
{
|
|
326
|
+
tool: "drawPoint",
|
|
327
|
+
title: "点标记",
|
|
328
|
+
iconClasses: ["fa", "fa-map-marker"],
|
|
329
|
+
// 地图标记点,比空心圆更直观
|
|
330
|
+
drawType: "point"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
tool: "drawLine",
|
|
334
|
+
title: "线标记",
|
|
335
|
+
iconClasses: ["fa", "fa-slash"],
|
|
336
|
+
// 斜线比短横线更像"线"的概念
|
|
337
|
+
drawType: "polyline"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
tool: "drawPolygon",
|
|
341
|
+
title: "面标记",
|
|
342
|
+
iconClasses: ["fa-solid", "fa-draw-polygon"],
|
|
343
|
+
// 多边形绘制图标,语义明确
|
|
344
|
+
drawType: "polygon"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
tool: "drawCircle",
|
|
348
|
+
title: "圆标记",
|
|
349
|
+
iconClasses: ["fa", "fa-circle"],
|
|
350
|
+
// 实心圆表示圆
|
|
351
|
+
drawType: "circle"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
tool: "drawRectangle",
|
|
355
|
+
title: "矩形标记",
|
|
356
|
+
iconClasses: ["fa-regular", "fa-square"],
|
|
357
|
+
// 空心方块,与圆标记风格统一
|
|
358
|
+
drawType: "rectangle"
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
tool: "drawFreePolygon",
|
|
362
|
+
title: "自由多边形",
|
|
363
|
+
iconClasses: ["fa", "fa-pencil"],
|
|
364
|
+
// 铅笔表示自由绘制
|
|
365
|
+
drawType: "freePolygon"
|
|
366
|
+
}
|
|
367
|
+
];
|
|
368
|
+
return (_ctx, _cache) => {
|
|
369
|
+
return openBlock(), createElementBlock("div", {
|
|
370
|
+
class: normalizeClass(["toolbar-panel", { collapsed: isCollapsed.value }])
|
|
371
|
+
}, [
|
|
372
|
+
createElementVNode("div", {
|
|
373
|
+
class: "panel-header",
|
|
374
|
+
onClick: toggleCollapse
|
|
375
|
+
}, [
|
|
376
|
+
createElementVNode("i", {
|
|
377
|
+
class: normalizeClass([
|
|
378
|
+
"toggle-icon",
|
|
379
|
+
"fa",
|
|
380
|
+
isCollapsed.value ? "fa-chevron-down" : "fa-chevron-up"
|
|
381
|
+
])
|
|
382
|
+
}, null, 2)
|
|
383
|
+
]),
|
|
384
|
+
withDirectives(createElementVNode("div", _hoisted_1$4, [
|
|
385
|
+
createElementVNode("div", _hoisted_2$3, [
|
|
386
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(measureTools, (item) => {
|
|
387
|
+
return createElementVNode("div", {
|
|
388
|
+
key: item.tool,
|
|
389
|
+
class: "menu-item",
|
|
390
|
+
title: item.title,
|
|
391
|
+
onClick: ($event) => activateTool(item.tool)
|
|
392
|
+
}, [
|
|
393
|
+
createElementVNode("i", {
|
|
394
|
+
class: normalizeClass(item.iconClasses)
|
|
395
|
+
}, null, 2)
|
|
396
|
+
], 8, _hoisted_3$3);
|
|
397
|
+
}), 64))
|
|
398
|
+
]),
|
|
399
|
+
_cache[2] || (_cache[2] = createElementVNode("div", { class: "divider" }, null, -1)),
|
|
400
|
+
createElementVNode("div", _hoisted_4$3, [
|
|
401
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(drawTools, (item) => {
|
|
402
|
+
return createElementVNode("div", {
|
|
403
|
+
key: item.tool,
|
|
404
|
+
class: normalizeClass(["menu-item", { active: __props.activeDrawType === item.drawType }]),
|
|
405
|
+
title: item.title,
|
|
406
|
+
onClick: ($event) => activateTool(item.tool)
|
|
407
|
+
}, [
|
|
408
|
+
createElementVNode("i", {
|
|
409
|
+
class: normalizeClass(item.iconClasses)
|
|
410
|
+
}, null, 2)
|
|
411
|
+
], 10, _hoisted_5$2);
|
|
412
|
+
}), 64)),
|
|
413
|
+
_cache[1] || (_cache[1] = createElementVNode("div", { class: "divider" }, null, -1)),
|
|
414
|
+
createElementVNode("div", {
|
|
415
|
+
class: "menu-item",
|
|
416
|
+
title: "清除全部",
|
|
417
|
+
onClick: emitClear
|
|
418
|
+
}, [..._cache[0] || (_cache[0] = [
|
|
419
|
+
createElementVNode("i", { class: "fa-solid fa-trash-can" }, null, -1)
|
|
420
|
+
])])
|
|
421
|
+
])
|
|
422
|
+
], 512), [
|
|
423
|
+
[vShow, !isCollapsed.value]
|
|
424
|
+
])
|
|
425
|
+
], 2);
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
const _export_sfc = (sfc, props) => {
|
|
430
|
+
const target = sfc.__vccOpts || sfc;
|
|
431
|
+
for (const [key, val] of props) {
|
|
432
|
+
target[key] = val;
|
|
433
|
+
}
|
|
434
|
+
return target;
|
|
435
|
+
};
|
|
436
|
+
const ToolbarPanel = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-f9e69b7a"]]);
|
|
437
|
+
const _hoisted_1$3 = {
|
|
438
|
+
key: 0,
|
|
439
|
+
class: "vision-popup"
|
|
440
|
+
};
|
|
441
|
+
const _hoisted_2$2 = { class: "popup-header" };
|
|
442
|
+
const _hoisted_3$2 = { class: "popup-content" };
|
|
443
|
+
const _hoisted_4$2 = ["onClick"];
|
|
444
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
445
|
+
__name: "VisionPanel",
|
|
446
|
+
props: {
|
|
447
|
+
circleFlyActive: { type: Boolean },
|
|
448
|
+
flyToActive: { type: Boolean },
|
|
449
|
+
firstPersonActive: { type: Boolean },
|
|
450
|
+
keyboardNavigateActive: { type: Boolean }
|
|
451
|
+
},
|
|
452
|
+
emits: ["visionExecute"],
|
|
453
|
+
setup(__props, { emit: __emit }) {
|
|
454
|
+
const props = __props;
|
|
455
|
+
const emit = __emit;
|
|
456
|
+
const popupVisible = ref(false);
|
|
457
|
+
const togglePopup = () => {
|
|
458
|
+
popupVisible.value = !popupVisible.value;
|
|
459
|
+
};
|
|
460
|
+
const execute = (action) => {
|
|
461
|
+
emit("visionExecute", action);
|
|
462
|
+
};
|
|
463
|
+
const visionItems = [
|
|
464
|
+
{
|
|
465
|
+
action: "circleFly",
|
|
466
|
+
icon: "fa-refresh",
|
|
467
|
+
label: "环绕飞行",
|
|
468
|
+
activeLabel: "关闭环绕飞行",
|
|
469
|
+
activeProp: "circleFlyActive"
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
action: "flyTo",
|
|
473
|
+
icon: "fa-location-arrow",
|
|
474
|
+
label: "移动到此处",
|
|
475
|
+
activeProp: "flyToActive"
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
action: "firstPerson",
|
|
479
|
+
icon: "fa-user",
|
|
480
|
+
label: "开启第一视角",
|
|
481
|
+
activeLabel: "关闭第一视角",
|
|
482
|
+
activeProp: "firstPersonActive"
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
action: "keyboardNavigate",
|
|
486
|
+
icon: "fa-keyboard-o",
|
|
487
|
+
label: "开启键盘漫游",
|
|
488
|
+
activeLabel: "关闭键盘漫游",
|
|
489
|
+
activeProp: "keyboardNavigateActive"
|
|
490
|
+
}
|
|
491
|
+
];
|
|
492
|
+
const isActive = (item) => item.activeProp ? !!props[item.activeProp] : false;
|
|
493
|
+
const getLabel = (item) => isActive(item) && item.activeLabel ? item.activeLabel : item.label;
|
|
494
|
+
return (_ctx, _cache) => {
|
|
495
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
496
|
+
createElementVNode("div", {
|
|
497
|
+
class: "vision-button",
|
|
498
|
+
title: "视觉功能",
|
|
499
|
+
onClick: togglePopup
|
|
500
|
+
}, [..._cache[1] || (_cache[1] = [
|
|
501
|
+
createElementVNode("i", { class: "fa fa-eye" }, null, -1)
|
|
502
|
+
])]),
|
|
503
|
+
createVNode(Transition, { name: "vision-fade" }, {
|
|
504
|
+
default: withCtx(() => [
|
|
505
|
+
popupVisible.value ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
506
|
+
createElementVNode("div", _hoisted_2$2, [
|
|
507
|
+
_cache[2] || (_cache[2] = createElementVNode("span", null, "视觉功能", -1)),
|
|
508
|
+
createElementVNode("i", {
|
|
509
|
+
class: "fa fa-times close-icon",
|
|
510
|
+
onClick: _cache[0] || (_cache[0] = ($event) => popupVisible.value = false)
|
|
511
|
+
})
|
|
512
|
+
]),
|
|
513
|
+
createElementVNode("div", _hoisted_3$2, [
|
|
514
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(visionItems, (item) => {
|
|
515
|
+
return createElementVNode("div", {
|
|
516
|
+
key: item.action,
|
|
517
|
+
class: normalizeClass(["popup-item", { active: isActive(item) }]),
|
|
518
|
+
onClick: ($event) => execute(item.action)
|
|
519
|
+
}, [
|
|
520
|
+
createElementVNode("i", {
|
|
521
|
+
class: normalizeClass(["fa", item.icon])
|
|
522
|
+
}, null, 2),
|
|
523
|
+
createElementVNode("span", null, toDisplayString(getLabel(item)), 1)
|
|
524
|
+
], 10, _hoisted_4$2);
|
|
525
|
+
}), 64))
|
|
526
|
+
])
|
|
527
|
+
])) : createCommentVNode("", true)
|
|
528
|
+
]),
|
|
529
|
+
_: 1
|
|
530
|
+
})
|
|
531
|
+
], 64);
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
});
|
|
535
|
+
const VisionPanel = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-4fc03fe1"]]);
|
|
536
|
+
function useMap() {
|
|
537
|
+
const Cesium = mars3d.Cesium;
|
|
538
|
+
const mapRef = shallowRef(null);
|
|
539
|
+
const graphicLayer = shallowRef(null);
|
|
540
|
+
const measureLayer = shallowRef(null);
|
|
541
|
+
const selectedGraphic = ref(null);
|
|
542
|
+
const lastClickPosition = ref(null);
|
|
543
|
+
function initMap(map) {
|
|
544
|
+
mapRef.value = map;
|
|
545
|
+
const gLayer = new mars3d.layer.GraphicLayer();
|
|
546
|
+
map.addLayer(gLayer);
|
|
547
|
+
graphicLayer.value = gLayer;
|
|
548
|
+
const mLayer = new mars3d.layer.GraphicLayer();
|
|
549
|
+
map.addLayer(mLayer);
|
|
550
|
+
measureLayer.value = mLayer;
|
|
551
|
+
map.on(mars3d.EventType.click, (event) => {
|
|
552
|
+
if (event.lnglat) {
|
|
553
|
+
lastClickPosition.value = event.lnglat;
|
|
554
|
+
} else if (event.cartesian) {
|
|
555
|
+
const carto = Cesium.Ellipsoid.WGS84.cartesianToCartographic(event.cartesian);
|
|
556
|
+
lastClickPosition.value = {
|
|
557
|
+
lng: Cesium.Math.toDegrees(carto.longitude),
|
|
558
|
+
lat: Cesium.Math.toDegrees(carto.latitude),
|
|
559
|
+
alt: carto.height > 0 ? carto.height : 5e3
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
});
|
|
563
|
+
gLayer.on(mars3d.EventType.click, (event) => {
|
|
564
|
+
selectedGraphic.value = event.graphic;
|
|
565
|
+
});
|
|
566
|
+
gLayer.on(mars3d.EventType.mouseOver, (event) => {
|
|
567
|
+
if (!selectedGraphic.value) {
|
|
568
|
+
selectedGraphic.value = event.graphic;
|
|
569
|
+
}
|
|
570
|
+
});
|
|
571
|
+
gLayer.on(mars3d.EventType.mouseOut, (event) => {
|
|
572
|
+
if (selectedGraphic.value === event.graphic) {
|
|
573
|
+
selectedGraphic.value = null;
|
|
574
|
+
}
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
function destroyMap() {
|
|
578
|
+
if (mapRef.value) {
|
|
579
|
+
mapRef.value.destroy();
|
|
580
|
+
mapRef.value = null;
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
function addGraphic(graphic) {
|
|
584
|
+
var _a;
|
|
585
|
+
(_a = graphicLayer.value) == null ? void 0 : _a.addGraphic(graphic);
|
|
586
|
+
}
|
|
587
|
+
function addThing(thing) {
|
|
588
|
+
var _a;
|
|
589
|
+
(_a = mapRef.value) == null ? void 0 : _a.addThing(thing);
|
|
590
|
+
}
|
|
591
|
+
return {
|
|
592
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
593
|
+
map: mapRef,
|
|
594
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
595
|
+
graphicLayer,
|
|
596
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
597
|
+
measureLayer,
|
|
598
|
+
selectedGraphic,
|
|
599
|
+
lastClickPosition,
|
|
600
|
+
initMap,
|
|
601
|
+
destroyMap,
|
|
602
|
+
addGraphic,
|
|
603
|
+
addThing
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
function useMeasure(mapContext) {
|
|
607
|
+
const measureThing = shallowRef(null);
|
|
608
|
+
function initMeasure() {
|
|
609
|
+
const map = mapContext.map.value;
|
|
610
|
+
const layer = mapContext.measureLayer.value;
|
|
611
|
+
if (!map || !layer) return;
|
|
612
|
+
const m = new mars3d.thing.Measure({ graphicLayer: layer });
|
|
613
|
+
map.addThing(m);
|
|
614
|
+
measureThing.value = m;
|
|
615
|
+
}
|
|
616
|
+
function measureDistance(style) {
|
|
617
|
+
var _a;
|
|
618
|
+
(_a = measureThing.value) == null ? void 0 : _a.distance({
|
|
619
|
+
style: { color: "#3388ff", width: 3, ...style }
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
function measureArea(style) {
|
|
623
|
+
var _a;
|
|
624
|
+
(_a = measureThing.value) == null ? void 0 : _a.area({
|
|
625
|
+
style: { color: "#3388ff", opacity: 0.5, ...style }
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
function measureHeight(style) {
|
|
629
|
+
var _a;
|
|
630
|
+
(_a = measureThing.value) == null ? void 0 : _a.height({
|
|
631
|
+
style: { color: "#3388ff", width: 3, ...style }
|
|
632
|
+
});
|
|
633
|
+
}
|
|
634
|
+
function measureAngle(style) {
|
|
635
|
+
var _a;
|
|
636
|
+
(_a = measureThing.value) == null ? void 0 : _a.angle({
|
|
637
|
+
style: { color: "#3388ff", width: 3, ...style }
|
|
638
|
+
});
|
|
639
|
+
}
|
|
640
|
+
function clearMeasure() {
|
|
641
|
+
var _a, _b;
|
|
642
|
+
(_a = measureThing.value) == null ? void 0 : _a.clear();
|
|
643
|
+
(_b = mapContext.measureLayer.value) == null ? void 0 : _b.clear();
|
|
644
|
+
}
|
|
645
|
+
return {
|
|
646
|
+
measureThing,
|
|
647
|
+
initMeasure,
|
|
648
|
+
measureDistance,
|
|
649
|
+
measureArea,
|
|
650
|
+
measureHeight,
|
|
651
|
+
measureAngle,
|
|
652
|
+
clearMeasure
|
|
653
|
+
};
|
|
654
|
+
}
|
|
655
|
+
function useDraw(mapContext) {
|
|
656
|
+
const currentDraw = shallowRef(null);
|
|
657
|
+
const activeDrawType = ref(null);
|
|
658
|
+
function getLayer() {
|
|
659
|
+
return mapContext.measureLayer.value;
|
|
660
|
+
}
|
|
661
|
+
function startDraw(type, style, drawType) {
|
|
662
|
+
const layer = getLayer();
|
|
663
|
+
if (!layer) return;
|
|
664
|
+
stopDraw();
|
|
665
|
+
currentDraw.value = layer.startDraw({ type, style });
|
|
666
|
+
activeDrawType.value = drawType;
|
|
667
|
+
}
|
|
668
|
+
function drawPoint(style) {
|
|
669
|
+
startDraw("point", { pixelSize: 10, color: "#ff0000", ...style }, "point");
|
|
670
|
+
}
|
|
671
|
+
function drawLine(style) {
|
|
672
|
+
startDraw("polyline", { width: 3, color: "#3388ff", ...style }, "polyline");
|
|
673
|
+
}
|
|
674
|
+
function drawPolygon(style) {
|
|
675
|
+
startDraw("polygon", { color: "#3388ff", opacity: 0.5, ...style }, "polygon");
|
|
676
|
+
}
|
|
677
|
+
function drawCircle(style) {
|
|
678
|
+
startDraw("circle", { radius: 1e3, color: "#00ff00", opacity: 0.3, ...style }, "circle");
|
|
679
|
+
}
|
|
680
|
+
function drawRectangle(style) {
|
|
681
|
+
startDraw("rectangle", { color: "#3388ff", opacity: 0.5, ...style }, "rectangle");
|
|
682
|
+
}
|
|
683
|
+
function drawFreePolygon(style) {
|
|
684
|
+
startDraw(
|
|
685
|
+
"polygon",
|
|
686
|
+
{ color: "#3388ff", opacity: 0.5, clampToGround: true, ...style },
|
|
687
|
+
"freePolygon"
|
|
688
|
+
);
|
|
689
|
+
}
|
|
690
|
+
function stopDraw() {
|
|
691
|
+
var _a;
|
|
692
|
+
if (currentDraw.value) {
|
|
693
|
+
(_a = getLayer()) == null ? void 0 : _a.stopDraw();
|
|
694
|
+
currentDraw.value = null;
|
|
695
|
+
}
|
|
696
|
+
activeDrawType.value = null;
|
|
697
|
+
}
|
|
698
|
+
function clearDraw() {
|
|
699
|
+
var _a;
|
|
700
|
+
stopDraw();
|
|
701
|
+
(_a = getLayer()) == null ? void 0 : _a.clear();
|
|
702
|
+
}
|
|
703
|
+
return {
|
|
704
|
+
currentDraw,
|
|
705
|
+
activeDrawType,
|
|
706
|
+
drawPoint,
|
|
707
|
+
drawLine,
|
|
708
|
+
drawPolygon,
|
|
709
|
+
drawCircle,
|
|
710
|
+
drawRectangle,
|
|
711
|
+
drawFreePolygon,
|
|
712
|
+
stopDraw,
|
|
713
|
+
clearDraw
|
|
714
|
+
};
|
|
715
|
+
}
|
|
716
|
+
function useVision(mapContext) {
|
|
717
|
+
const circleFlyActive = ref(false);
|
|
718
|
+
const firstPersonActive = ref(false);
|
|
719
|
+
const keyboardActive = ref(false);
|
|
720
|
+
const flyToActive = ref(false);
|
|
721
|
+
const rotatePoint = shallowRef(null);
|
|
722
|
+
const firstPersonRoam = shallowRef(null);
|
|
723
|
+
const keyboardRoam = shallowRef(null);
|
|
724
|
+
let initialCameraView = null;
|
|
725
|
+
function getMap() {
|
|
726
|
+
return mapContext.map.value;
|
|
727
|
+
}
|
|
728
|
+
function toggleCircleFly() {
|
|
729
|
+
const map = getMap();
|
|
730
|
+
if (!map) return;
|
|
731
|
+
if (rotatePoint.value) {
|
|
732
|
+
if (rotatePoint.value.isStart) {
|
|
733
|
+
rotatePoint.value.stop();
|
|
734
|
+
}
|
|
735
|
+
map.removeThing(rotatePoint.value);
|
|
736
|
+
rotatePoint.value = null;
|
|
737
|
+
circleFlyActive.value = false;
|
|
738
|
+
return;
|
|
739
|
+
}
|
|
740
|
+
const center = map.getCenter();
|
|
741
|
+
const rp = new mars3d.thing.RotatePoint({ distance: 5e3, time: 30 });
|
|
742
|
+
map.addThing(rp);
|
|
743
|
+
rp.start(center);
|
|
744
|
+
rotatePoint.value = rp;
|
|
745
|
+
circleFlyActive.value = true;
|
|
746
|
+
}
|
|
747
|
+
function flyTo() {
|
|
748
|
+
const map = getMap();
|
|
749
|
+
if (!map) return;
|
|
750
|
+
flyToActive.value = true;
|
|
751
|
+
const done = () => setTimeout(() => {
|
|
752
|
+
flyToActive.value = false;
|
|
753
|
+
}, 2e3);
|
|
754
|
+
const pos = mapContext.lastClickPosition.value;
|
|
755
|
+
if (pos) {
|
|
756
|
+
const target = { ...pos, alt: pos.alt > 0 ? pos.alt : 5e3 };
|
|
757
|
+
map.setCameraView(target, { duration: 2, complete: done });
|
|
758
|
+
} else {
|
|
759
|
+
map.flyHome({ duration: 2 });
|
|
760
|
+
done();
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
function toggleFirstPerson() {
|
|
764
|
+
const map = getMap();
|
|
765
|
+
if (!map) return;
|
|
766
|
+
if (!firstPersonRoam.value) {
|
|
767
|
+
const roam = new mars3d.thing.FirstPersonRoam({});
|
|
768
|
+
map.addThing(roam);
|
|
769
|
+
initialCameraView = map.getCameraView();
|
|
770
|
+
roam.enabled = true;
|
|
771
|
+
firstPersonRoam.value = roam;
|
|
772
|
+
firstPersonActive.value = true;
|
|
773
|
+
} else {
|
|
774
|
+
const roam = firstPersonRoam.value;
|
|
775
|
+
roam.enabled = !roam.enabled;
|
|
776
|
+
firstPersonActive.value = roam.enabled;
|
|
777
|
+
if (!roam.enabled && initialCameraView) {
|
|
778
|
+
map.setCameraView(initialCameraView, { duration: 1 });
|
|
779
|
+
} else if (roam.enabled) {
|
|
780
|
+
initialCameraView = map.getCameraView();
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
function toggleKeyboardNavigate() {
|
|
785
|
+
const map = getMap();
|
|
786
|
+
if (!map) return;
|
|
787
|
+
if (!keyboardRoam.value) {
|
|
788
|
+
const roam = new mars3d.thing.KeyboardRoam({});
|
|
789
|
+
map.addThing(roam);
|
|
790
|
+
roam.enabled = true;
|
|
791
|
+
keyboardRoam.value = roam;
|
|
792
|
+
keyboardActive.value = true;
|
|
793
|
+
} else {
|
|
794
|
+
const roam = keyboardRoam.value;
|
|
795
|
+
roam.enabled = !roam.enabled;
|
|
796
|
+
keyboardActive.value = roam.enabled;
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
return {
|
|
800
|
+
// 状态
|
|
801
|
+
circleFlyActive,
|
|
802
|
+
firstPersonActive,
|
|
803
|
+
keyboardActive,
|
|
804
|
+
flyToActive,
|
|
805
|
+
// 方法
|
|
806
|
+
toggleCircleFly,
|
|
807
|
+
flyTo,
|
|
808
|
+
toggleFirstPerson,
|
|
809
|
+
toggleKeyboardNavigate
|
|
810
|
+
};
|
|
811
|
+
}
|
|
812
|
+
const _hoisted_1$2 = { class: "mars-map-container" };
|
|
813
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
814
|
+
__name: "MarsMapContainer",
|
|
815
|
+
props: {
|
|
816
|
+
configUrl: { default: "config/config.json" },
|
|
817
|
+
mapKey: { default: "default" },
|
|
818
|
+
hideToolbar: { type: Boolean, default: false },
|
|
819
|
+
hideVision: { type: Boolean, default: false }
|
|
820
|
+
},
|
|
821
|
+
emits: ["onload"],
|
|
822
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
823
|
+
const emit = __emit;
|
|
824
|
+
const mapCtx = useMap();
|
|
825
|
+
const measure = useMeasure(mapCtx);
|
|
826
|
+
const draw = useDraw(mapCtx);
|
|
827
|
+
const vision = useVision(mapCtx);
|
|
828
|
+
provide("mapContext", mapCtx);
|
|
829
|
+
provide("measureContext", measure);
|
|
830
|
+
provide("drawContext", draw);
|
|
831
|
+
provide("visionContext", vision);
|
|
832
|
+
function onMapLoad(map) {
|
|
833
|
+
mapCtx.initMap(map);
|
|
834
|
+
measure.initMeasure();
|
|
835
|
+
emit("onload", map);
|
|
836
|
+
}
|
|
837
|
+
function handleToolActivate(tool) {
|
|
838
|
+
switch (tool) {
|
|
839
|
+
case "measureDistance":
|
|
840
|
+
measure.measureDistance();
|
|
841
|
+
break;
|
|
842
|
+
case "measureArea":
|
|
843
|
+
measure.measureArea();
|
|
844
|
+
break;
|
|
845
|
+
case "measureHeight":
|
|
846
|
+
measure.measureHeight();
|
|
847
|
+
break;
|
|
848
|
+
case "measureAngle":
|
|
849
|
+
measure.measureAngle();
|
|
850
|
+
break;
|
|
851
|
+
case "drawPoint":
|
|
852
|
+
draw.drawPoint();
|
|
853
|
+
break;
|
|
854
|
+
case "drawLine":
|
|
855
|
+
draw.drawLine();
|
|
856
|
+
break;
|
|
857
|
+
case "drawPolygon":
|
|
858
|
+
draw.drawPolygon();
|
|
859
|
+
break;
|
|
860
|
+
case "drawCircle":
|
|
861
|
+
draw.drawCircle();
|
|
862
|
+
break;
|
|
863
|
+
case "drawRectangle":
|
|
864
|
+
draw.drawRectangle();
|
|
865
|
+
break;
|
|
866
|
+
case "drawFreePolygon":
|
|
867
|
+
draw.drawFreePolygon();
|
|
868
|
+
break;
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
function handleClear() {
|
|
872
|
+
measure.clearMeasure();
|
|
873
|
+
draw.clearDraw();
|
|
874
|
+
}
|
|
875
|
+
function handleVisionExecute(action) {
|
|
876
|
+
switch (action) {
|
|
877
|
+
case "circleFly":
|
|
878
|
+
vision.toggleCircleFly();
|
|
879
|
+
break;
|
|
880
|
+
case "flyTo":
|
|
881
|
+
vision.flyTo();
|
|
882
|
+
break;
|
|
883
|
+
case "firstPerson":
|
|
884
|
+
vision.toggleFirstPerson();
|
|
885
|
+
break;
|
|
886
|
+
case "keyboardNavigate":
|
|
887
|
+
vision.toggleKeyboardNavigate();
|
|
888
|
+
break;
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
__expose({
|
|
892
|
+
map: mapCtx.map,
|
|
893
|
+
graphicLayer: mapCtx.graphicLayer,
|
|
894
|
+
measureLayer: mapCtx.measureLayer,
|
|
895
|
+
selectedGraphic: mapCtx.selectedGraphic,
|
|
896
|
+
lastClickPosition: mapCtx.lastClickPosition,
|
|
897
|
+
addGraphic: mapCtx.addGraphic,
|
|
898
|
+
addThing: mapCtx.addThing,
|
|
899
|
+
measure,
|
|
900
|
+
draw,
|
|
901
|
+
vision
|
|
902
|
+
});
|
|
903
|
+
return (_ctx, _cache) => {
|
|
904
|
+
return openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
905
|
+
createVNode(_sfc_main$7, {
|
|
906
|
+
url: __props.configUrl,
|
|
907
|
+
"map-key": __props.mapKey,
|
|
908
|
+
onOnload: onMapLoad
|
|
909
|
+
}, null, 8, ["url", "map-key"]),
|
|
910
|
+
!__props.hideToolbar ? (openBlock(), createBlock(ToolbarPanel, {
|
|
911
|
+
key: 0,
|
|
912
|
+
"active-draw-type": unref(draw).activeDrawType.value,
|
|
913
|
+
onToolActivate: handleToolActivate,
|
|
914
|
+
onClear: handleClear
|
|
915
|
+
}, null, 8, ["active-draw-type"])) : createCommentVNode("", true),
|
|
916
|
+
!__props.hideVision ? (openBlock(), createBlock(VisionPanel, {
|
|
917
|
+
key: 1,
|
|
918
|
+
"circle-fly-active": unref(vision).circleFlyActive.value,
|
|
919
|
+
"fly-to-active": unref(vision).flyToActive.value,
|
|
920
|
+
"first-person-active": unref(vision).firstPersonActive.value,
|
|
921
|
+
"keyboard-navigate-active": unref(vision).keyboardActive.value,
|
|
922
|
+
onVisionExecute: handleVisionExecute
|
|
923
|
+
}, null, 8, ["circle-fly-active", "fly-to-active", "first-person-active", "keyboard-navigate-active"])) : createCommentVNode("", true),
|
|
924
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
925
|
+
]);
|
|
926
|
+
};
|
|
927
|
+
}
|
|
928
|
+
});
|
|
929
|
+
const MarsMapContainer = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-9c769713"]]);
|
|
930
|
+
const CATEGORY_ICON = {
|
|
931
|
+
default: "//data.mars3d.cn/img/marker/mark-blue.png",
|
|
932
|
+
warning: "//data.mars3d.cn/img/marker/mark-red.png",
|
|
933
|
+
info: "//data.mars3d.cn/img/marker/mark-green.png"
|
|
934
|
+
};
|
|
935
|
+
let _idCounter$1 = 1;
|
|
936
|
+
function usePoiMarker(mapCtx) {
|
|
937
|
+
const poiLayer = shallowRef(null);
|
|
938
|
+
const poiList = ref([]);
|
|
939
|
+
const activePoiId = ref(null);
|
|
940
|
+
function initPoiLayer() {
|
|
941
|
+
const map = mapCtx.map.value;
|
|
942
|
+
if (!map) return;
|
|
943
|
+
const layer = new mars3d.layer.GraphicLayer();
|
|
944
|
+
map.addLayer(layer);
|
|
945
|
+
poiLayer.value = layer;
|
|
946
|
+
layer.on(mars3d.EventType.click, (e) => {
|
|
947
|
+
var _a, _b;
|
|
948
|
+
const poiId = (_b = (_a = e.graphic) == null ? void 0 : _a.attr) == null ? void 0 : _b.poiId;
|
|
949
|
+
if (poiId) selectPoi(poiId);
|
|
950
|
+
});
|
|
951
|
+
}
|
|
952
|
+
function addPoi(params) {
|
|
953
|
+
const layer = poiLayer.value;
|
|
954
|
+
if (!layer) return null;
|
|
955
|
+
const id = `poi-${_idCounter$1++}`;
|
|
956
|
+
const graphic = new mars3d.graphic.BillboardEntity({
|
|
957
|
+
position: [params.lng, params.lat, params.alt],
|
|
958
|
+
style: {
|
|
959
|
+
image: CATEGORY_ICON[params.category],
|
|
960
|
+
scale: 1,
|
|
961
|
+
horizontalOrigin: mars3d.Cesium.HorizontalOrigin.CENTER,
|
|
962
|
+
verticalOrigin: mars3d.Cesium.VerticalOrigin.BOTTOM,
|
|
963
|
+
clampToGround: false,
|
|
964
|
+
// 标注文字
|
|
965
|
+
label: {
|
|
966
|
+
text: params.name,
|
|
967
|
+
font_size: 14,
|
|
968
|
+
color: "#ffffff",
|
|
969
|
+
outline: true,
|
|
970
|
+
outlineColor: "#333333",
|
|
971
|
+
outlineWidth: 2,
|
|
972
|
+
pixelOffset: new mars3d.Cesium.Cartesian2(0, -40),
|
|
973
|
+
visibleDepth: false
|
|
974
|
+
}
|
|
975
|
+
},
|
|
976
|
+
// popup 弹窗(点击标注时自动展示)
|
|
977
|
+
popup: buildPopupHtml(params),
|
|
978
|
+
attr: { poiId: id, name: params.name }
|
|
979
|
+
});
|
|
980
|
+
layer.addGraphic(graphic);
|
|
981
|
+
const poi = { ...params, id, graphic };
|
|
982
|
+
poiList.value.push(poi);
|
|
983
|
+
return poi;
|
|
984
|
+
}
|
|
985
|
+
function removePoi(id) {
|
|
986
|
+
var _a;
|
|
987
|
+
const idx = poiList.value.findIndex((p) => p.id === id);
|
|
988
|
+
if (idx === -1) return;
|
|
989
|
+
const poi = poiList.value[idx];
|
|
990
|
+
poi.graphic && ((_a = poiLayer.value) == null ? void 0 : _a.removeGraphic(poi.graphic));
|
|
991
|
+
poiList.value.splice(idx, 1);
|
|
992
|
+
if (activePoiId.value === id) activePoiId.value = null;
|
|
993
|
+
}
|
|
994
|
+
function selectPoi(id, flyTo = false) {
|
|
995
|
+
activePoiId.value = id;
|
|
996
|
+
const poi = poiList.value.find((p) => p.id === id);
|
|
997
|
+
if (!poi) return;
|
|
998
|
+
poiList.value.forEach((p) => {
|
|
999
|
+
if (p.graphic) {
|
|
1000
|
+
p.graphic.style.scale = p.id === id ? 1.4 : 1;
|
|
1001
|
+
}
|
|
1002
|
+
});
|
|
1003
|
+
if (flyTo) flyToPoi(id);
|
|
1004
|
+
}
|
|
1005
|
+
function updatePoiName(id, newName) {
|
|
1006
|
+
var _a, _b, _c;
|
|
1007
|
+
const poi = poiList.value.find((p) => p.id === id);
|
|
1008
|
+
if (!poi) return;
|
|
1009
|
+
poi.name = newName;
|
|
1010
|
+
if (poi.graphic) {
|
|
1011
|
+
poi.graphic.attr = { ...poi.graphic.attr, name: newName };
|
|
1012
|
+
poi.graphic.popup = buildPopupHtml(poi);
|
|
1013
|
+
if ((_a = poi.graphic.style) == null ? void 0 : _a.label) {
|
|
1014
|
+
poi.graphic.style.label.text = newName;
|
|
1015
|
+
}
|
|
1016
|
+
(_c = (_b = poi.graphic).closePopup) == null ? void 0 : _c.call(_b);
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
function flyToPoi(id) {
|
|
1020
|
+
const poi = poiList.value.find((p) => p.id === id);
|
|
1021
|
+
if (!poi || !mapCtx.map.value) return;
|
|
1022
|
+
const map = mapCtx.map.value;
|
|
1023
|
+
const baseAlt = poi.alt > 1 ? poi.alt : 50;
|
|
1024
|
+
const flyAlt = baseAlt + 1500;
|
|
1025
|
+
map.setCameraView({ lng: poi.lng, lat: poi.lat, alt: flyAlt }, { duration: 1.5 });
|
|
1026
|
+
}
|
|
1027
|
+
function clearAll() {
|
|
1028
|
+
var _a;
|
|
1029
|
+
(_a = poiLayer.value) == null ? void 0 : _a.clear();
|
|
1030
|
+
poiList.value = [];
|
|
1031
|
+
activePoiId.value = null;
|
|
1032
|
+
}
|
|
1033
|
+
const isAddMode = ref(false);
|
|
1034
|
+
let _clickHandler = null;
|
|
1035
|
+
function toggleAddMode(onAdded, defaultName = "新标注", category = "default") {
|
|
1036
|
+
const map = mapCtx.map.value;
|
|
1037
|
+
if (!map) return;
|
|
1038
|
+
if (isAddMode.value) {
|
|
1039
|
+
if (_clickHandler) {
|
|
1040
|
+
map.off(mars3d.EventType.click, _clickHandler);
|
|
1041
|
+
_clickHandler = null;
|
|
1042
|
+
}
|
|
1043
|
+
isAddMode.value = false;
|
|
1044
|
+
} else {
|
|
1045
|
+
isAddMode.value = true;
|
|
1046
|
+
_clickHandler = (e) => {
|
|
1047
|
+
let lng, lat, alt;
|
|
1048
|
+
if (e.lnglat) {
|
|
1049
|
+
lng = e.lnglat.lng;
|
|
1050
|
+
lat = e.lnglat.lat;
|
|
1051
|
+
alt = e.lnglat.alt ?? 0;
|
|
1052
|
+
} else if (e.cartesian) {
|
|
1053
|
+
const carto = mars3d.Cesium.Cartographic.fromCartesian(e.cartesian);
|
|
1054
|
+
lng = mars3d.Cesium.Math.toDegrees(carto.longitude);
|
|
1055
|
+
lat = mars3d.Cesium.Math.toDegrees(carto.latitude);
|
|
1056
|
+
alt = carto.height > 0 ? carto.height : 50;
|
|
1057
|
+
} else {
|
|
1058
|
+
return;
|
|
1059
|
+
}
|
|
1060
|
+
const finalAlt = alt > 1 ? alt : 50;
|
|
1061
|
+
const poi = addPoi({
|
|
1062
|
+
name: `${defaultName} ${_idCounter$1}`,
|
|
1063
|
+
lng,
|
|
1064
|
+
lat,
|
|
1065
|
+
alt: finalAlt,
|
|
1066
|
+
category
|
|
1067
|
+
});
|
|
1068
|
+
if (poi) onAdded == null ? void 0 : onAdded(poi);
|
|
1069
|
+
toggleAddMode();
|
|
1070
|
+
};
|
|
1071
|
+
map.on(mars3d.EventType.click, _clickHandler);
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
return {
|
|
1075
|
+
poiLayer,
|
|
1076
|
+
poiList,
|
|
1077
|
+
activePoiId,
|
|
1078
|
+
isAddMode,
|
|
1079
|
+
initPoiLayer,
|
|
1080
|
+
addPoi,
|
|
1081
|
+
removePoi,
|
|
1082
|
+
selectPoi,
|
|
1083
|
+
flyToPoi,
|
|
1084
|
+
updatePoiName,
|
|
1085
|
+
clearAll,
|
|
1086
|
+
toggleAddMode
|
|
1087
|
+
};
|
|
1088
|
+
}
|
|
1089
|
+
function buildPopupHtml(poi) {
|
|
1090
|
+
return `
|
|
1091
|
+
<div style="padding:8px 12px;min-width:160px;">
|
|
1092
|
+
<div style="font-size:15px;font-weight:bold;margin-bottom:6px;color:#fff;">${poi.name}</div>
|
|
1093
|
+
<div style="font-size:12px;color:#adc6e5;line-height:1.8;">
|
|
1094
|
+
<div>经度:${poi.lng.toFixed(6)}</div>
|
|
1095
|
+
<div>纬度:${poi.lat.toFixed(6)}</div>
|
|
1096
|
+
<div>高度:${poi.alt.toFixed(1)} m</div>
|
|
1097
|
+
${poi.description ? `<div style="margin-top:4px;">${poi.description}</div>` : ""}
|
|
1098
|
+
</div>
|
|
1099
|
+
</div>
|
|
1100
|
+
`;
|
|
1101
|
+
}
|
|
1102
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
1103
|
+
__name: "PoiMarkerLayer",
|
|
1104
|
+
setup(__props, { expose: __expose }) {
|
|
1105
|
+
const mapCtx = inject("mapContext");
|
|
1106
|
+
if (!mapCtx) throw new Error("[PoiMarkerLayer] 必须放置在 MarsMapContainer 内部");
|
|
1107
|
+
const poi = usePoiMarker(mapCtx);
|
|
1108
|
+
const stopWatch = watch(
|
|
1109
|
+
() => mapCtx.map.value,
|
|
1110
|
+
(map) => {
|
|
1111
|
+
if (map) {
|
|
1112
|
+
poi.initPoiLayer();
|
|
1113
|
+
stopWatch();
|
|
1114
|
+
}
|
|
1115
|
+
},
|
|
1116
|
+
{ immediate: true }
|
|
1117
|
+
);
|
|
1118
|
+
onUnmounted(() => {
|
|
1119
|
+
poi.clearAll();
|
|
1120
|
+
});
|
|
1121
|
+
provide("poiContext", poi);
|
|
1122
|
+
__expose(poi);
|
|
1123
|
+
return (_ctx, _cache) => {
|
|
1124
|
+
return renderSlot(_ctx.$slots, "default");
|
|
1125
|
+
};
|
|
1126
|
+
}
|
|
1127
|
+
});
|
|
1128
|
+
const _hoisted_1$1 = {
|
|
1129
|
+
key: 0,
|
|
1130
|
+
class: "collapsed-icon-wrap"
|
|
1131
|
+
};
|
|
1132
|
+
const _hoisted_2$1 = { class: "poi-count poi-count--collapsed" };
|
|
1133
|
+
const _hoisted_3$1 = { class: "poi-panel__title" };
|
|
1134
|
+
const _hoisted_4$1 = { class: "poi-count" };
|
|
1135
|
+
const _hoisted_5$1 = { class: "poi-panel__body" };
|
|
1136
|
+
const _hoisted_6$1 = { class: "poi-panel__toolbar" };
|
|
1137
|
+
const _hoisted_7$1 = ["disabled"];
|
|
1138
|
+
const _hoisted_8$1 = { class: "poi-panel__filter" };
|
|
1139
|
+
const _hoisted_9$1 = ["onClick"];
|
|
1140
|
+
const _hoisted_10$1 = { class: "poi-panel__list" };
|
|
1141
|
+
const _hoisted_11$1 = ["onClick"];
|
|
1142
|
+
const _hoisted_12$1 = { class: "poi-item__info" };
|
|
1143
|
+
const _hoisted_13$1 = ["onDblclick"];
|
|
1144
|
+
const _hoisted_14$1 = { class: "poi-item__coord" };
|
|
1145
|
+
const _hoisted_15$1 = { class: "poi-item__actions" };
|
|
1146
|
+
const _hoisted_16$1 = ["onClick"];
|
|
1147
|
+
const _hoisted_17$1 = ["onClick"];
|
|
1148
|
+
const _hoisted_18$1 = ["onClick"];
|
|
1149
|
+
const _hoisted_19$1 = {
|
|
1150
|
+
key: 0,
|
|
1151
|
+
class: "poi-panel__empty"
|
|
1152
|
+
};
|
|
1153
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
1154
|
+
__name: "PoiMarkerPanel",
|
|
1155
|
+
setup(__props) {
|
|
1156
|
+
const poi = inject("poiContext");
|
|
1157
|
+
if (!poi) throw new Error("[PoiMarkerPanel] 必须与 PoiMarkerLayer 同级使用");
|
|
1158
|
+
const isCollapsed = ref(true);
|
|
1159
|
+
const toggleCollapse = () => {
|
|
1160
|
+
isCollapsed.value = !isCollapsed.value;
|
|
1161
|
+
};
|
|
1162
|
+
const panelEl = ref(null);
|
|
1163
|
+
const isDragging = ref(false);
|
|
1164
|
+
const pos = reactive({ x: 10, y: 10 });
|
|
1165
|
+
let dragStartX = 0;
|
|
1166
|
+
let dragStartY = 0;
|
|
1167
|
+
let origX = 0;
|
|
1168
|
+
let origY = 0;
|
|
1169
|
+
function startDrag(e) {
|
|
1170
|
+
isDragging.value = true;
|
|
1171
|
+
dragStartX = e.clientX;
|
|
1172
|
+
dragStartY = e.clientY;
|
|
1173
|
+
origX = pos.x;
|
|
1174
|
+
origY = pos.y;
|
|
1175
|
+
document.addEventListener("mousemove", onDrag);
|
|
1176
|
+
document.addEventListener("mouseup", stopDrag);
|
|
1177
|
+
}
|
|
1178
|
+
function onDrag(e) {
|
|
1179
|
+
if (!isDragging.value) return;
|
|
1180
|
+
pos.x = origX + (e.clientX - dragStartX);
|
|
1181
|
+
pos.y = origY + (e.clientY - dragStartY);
|
|
1182
|
+
}
|
|
1183
|
+
function stopDrag() {
|
|
1184
|
+
isDragging.value = false;
|
|
1185
|
+
document.removeEventListener("mousemove", onDrag);
|
|
1186
|
+
document.removeEventListener("mouseup", stopDrag);
|
|
1187
|
+
}
|
|
1188
|
+
const categories = [
|
|
1189
|
+
{ value: "all", label: "全部", icon: "fa-list", color: "#aaa" },
|
|
1190
|
+
{ value: "default", label: "普通", icon: "fa-map-marker", color: "#3ea6ff" },
|
|
1191
|
+
{
|
|
1192
|
+
value: "warning",
|
|
1193
|
+
label: "警告",
|
|
1194
|
+
icon: "fa-exclamation-triangle",
|
|
1195
|
+
color: "#ff6b6b"
|
|
1196
|
+
},
|
|
1197
|
+
{ value: "info", label: "信息", icon: "fa-info-circle", color: "#52c41a" }
|
|
1198
|
+
];
|
|
1199
|
+
const activeCategory = ref("all");
|
|
1200
|
+
const filteredList = computed(() => {
|
|
1201
|
+
if (activeCategory.value === "all") return poi.poiList.value;
|
|
1202
|
+
return poi.poiList.value.filter((p) => p.category === activeCategory.value);
|
|
1203
|
+
});
|
|
1204
|
+
const getCategoryColor = (cat) => {
|
|
1205
|
+
const map = {
|
|
1206
|
+
default: "#3ea6ff",
|
|
1207
|
+
warning: "#ff6b6b",
|
|
1208
|
+
info: "#52c41a"
|
|
1209
|
+
};
|
|
1210
|
+
return map[cat] ?? "#aaa";
|
|
1211
|
+
};
|
|
1212
|
+
const addCategory = ref("default");
|
|
1213
|
+
function toggleAdd() {
|
|
1214
|
+
poi.toggleAddMode(
|
|
1215
|
+
void 0,
|
|
1216
|
+
// onAdded 回调(可按需传)
|
|
1217
|
+
"标注点",
|
|
1218
|
+
addCategory.value
|
|
1219
|
+
);
|
|
1220
|
+
}
|
|
1221
|
+
function onSelect(id) {
|
|
1222
|
+
poi.selectPoi(id, true);
|
|
1223
|
+
}
|
|
1224
|
+
function onFlyTo(id) {
|
|
1225
|
+
poi.flyToPoi(id);
|
|
1226
|
+
}
|
|
1227
|
+
function onRemove(id) {
|
|
1228
|
+
poi.removePoi(id);
|
|
1229
|
+
}
|
|
1230
|
+
const editingId = ref(null);
|
|
1231
|
+
const editName = ref("");
|
|
1232
|
+
const editInputEl = ref(null);
|
|
1233
|
+
function startEdit(item) {
|
|
1234
|
+
editingId.value = item.id;
|
|
1235
|
+
editName.value = item.name;
|
|
1236
|
+
setTimeout(() => {
|
|
1237
|
+
var _a;
|
|
1238
|
+
return (_a = editInputEl.value) == null ? void 0 : _a.select();
|
|
1239
|
+
}, 30);
|
|
1240
|
+
}
|
|
1241
|
+
function saveEdit() {
|
|
1242
|
+
if (editingId.value && editName.value.trim()) {
|
|
1243
|
+
poi.updatePoiName(editingId.value, editName.value.trim());
|
|
1244
|
+
}
|
|
1245
|
+
cancelEdit();
|
|
1246
|
+
}
|
|
1247
|
+
function cancelEdit() {
|
|
1248
|
+
editingId.value = null;
|
|
1249
|
+
editName.value = "";
|
|
1250
|
+
}
|
|
1251
|
+
function confirmClear() {
|
|
1252
|
+
if (window.confirm(`确认清空全部 ${poi.poiList.value.length} 个标注?`)) {
|
|
1253
|
+
poi.clearAll();
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
return (_ctx, _cache) => {
|
|
1257
|
+
return openBlock(), createElementBlock("div", {
|
|
1258
|
+
ref_key: "panelEl",
|
|
1259
|
+
ref: panelEl,
|
|
1260
|
+
class: normalizeClass(["poi-panel", { collapsed: isCollapsed.value }]),
|
|
1261
|
+
style: normalizeStyle(
|
|
1262
|
+
!isCollapsed.value ? { left: pos.x + "px", top: pos.y + "px" } : { left: pos.x + "px", top: pos.y + "px" }
|
|
1263
|
+
)
|
|
1264
|
+
}, [
|
|
1265
|
+
createElementVNode("div", {
|
|
1266
|
+
class: normalizeClass(["poi-panel__header", { "is-dragging": isDragging.value }]),
|
|
1267
|
+
onMousedown: withModifiers(startDrag, ["prevent"]),
|
|
1268
|
+
onClick: _cache[0] || (_cache[0] = ($event) => isDragging.value ? null : toggleCollapse())
|
|
1269
|
+
}, [
|
|
1270
|
+
isCollapsed.value ? (openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
1271
|
+
_cache[3] || (_cache[3] = createElementVNode("i", { class: "fa fa-map-marker collapsed-icon" }, null, -1)),
|
|
1272
|
+
createElementVNode("span", _hoisted_2$1, toDisplayString(filteredList.value.length), 1)
|
|
1273
|
+
])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1274
|
+
createElementVNode("span", _hoisted_3$1, [
|
|
1275
|
+
_cache[4] || (_cache[4] = createElementVNode("i", { class: "fa fa-map-marker" }, null, -1)),
|
|
1276
|
+
_cache[5] || (_cache[5] = createTextVNode(" POI 标注管理 ", -1)),
|
|
1277
|
+
createElementVNode("span", _hoisted_4$1, toDisplayString(filteredList.value.length), 1)
|
|
1278
|
+
]),
|
|
1279
|
+
_cache[6] || (_cache[6] = createElementVNode("i", { class: "fa fa-chevron-left collapse-icon" }, null, -1))
|
|
1280
|
+
], 64))
|
|
1281
|
+
], 34),
|
|
1282
|
+
withDirectives(createElementVNode("div", _hoisted_5$1, [
|
|
1283
|
+
createElementVNode("div", _hoisted_6$1, [
|
|
1284
|
+
createElementVNode("button", {
|
|
1285
|
+
class: normalizeClass(["btn", { "btn--active": unref(poi).isAddMode.value }]),
|
|
1286
|
+
onClick: toggleAdd
|
|
1287
|
+
}, [
|
|
1288
|
+
createElementVNode("i", {
|
|
1289
|
+
class: normalizeClass(["fa", unref(poi).isAddMode.value ? "fa-times" : "fa-plus"])
|
|
1290
|
+
}, null, 2),
|
|
1291
|
+
createTextVNode(" " + toDisplayString(unref(poi).isAddMode.value ? "取消添加" : "点击地图添加"), 1)
|
|
1292
|
+
], 2),
|
|
1293
|
+
createElementVNode("button", {
|
|
1294
|
+
class: "btn btn--danger",
|
|
1295
|
+
onClick: confirmClear,
|
|
1296
|
+
disabled: unref(poi).poiList.value.length === 0
|
|
1297
|
+
}, [..._cache[7] || (_cache[7] = [
|
|
1298
|
+
createElementVNode("i", { class: "fa fa-trash-o" }, null, -1),
|
|
1299
|
+
createTextVNode(" 清空 ", -1)
|
|
1300
|
+
])], 8, _hoisted_7$1)
|
|
1301
|
+
]),
|
|
1302
|
+
createElementVNode("div", _hoisted_8$1, [
|
|
1303
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(categories, (cat) => {
|
|
1304
|
+
return createElementVNode("span", {
|
|
1305
|
+
key: cat.value,
|
|
1306
|
+
class: normalizeClass(["filter-tag", { active: activeCategory.value === cat.value }]),
|
|
1307
|
+
onClick: ($event) => activeCategory.value = cat.value
|
|
1308
|
+
}, [
|
|
1309
|
+
createElementVNode("i", {
|
|
1310
|
+
class: normalizeClass(["fa", cat.icon]),
|
|
1311
|
+
style: normalizeStyle({ color: cat.color })
|
|
1312
|
+
}, null, 6),
|
|
1313
|
+
createTextVNode(" " + toDisplayString(cat.label), 1)
|
|
1314
|
+
], 10, _hoisted_9$1);
|
|
1315
|
+
}), 64))
|
|
1316
|
+
]),
|
|
1317
|
+
createElementVNode("div", _hoisted_10$1, [
|
|
1318
|
+
createVNode(TransitionGroup, { name: "poi-list" }, {
|
|
1319
|
+
default: withCtx(() => [
|
|
1320
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(filteredList.value, (item) => {
|
|
1321
|
+
return openBlock(), createElementBlock("div", {
|
|
1322
|
+
key: item.id,
|
|
1323
|
+
class: normalizeClass(["poi-item", { "poi-item--active": unref(poi).activePoiId.value === item.id }]),
|
|
1324
|
+
onClick: ($event) => onSelect(item.id)
|
|
1325
|
+
}, [
|
|
1326
|
+
createElementVNode("span", {
|
|
1327
|
+
class: "poi-item__dot",
|
|
1328
|
+
style: normalizeStyle({ background: getCategoryColor(item.category) })
|
|
1329
|
+
}, null, 4),
|
|
1330
|
+
createElementVNode("div", _hoisted_12$1, [
|
|
1331
|
+
editingId.value === item.id ? withDirectives((openBlock(), createElementBlock("input", {
|
|
1332
|
+
key: 0,
|
|
1333
|
+
class: "poi-item__name-input",
|
|
1334
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => editName.value = $event),
|
|
1335
|
+
onKeydown: [
|
|
1336
|
+
withKeys(saveEdit, ["enter"]),
|
|
1337
|
+
withKeys(cancelEdit, ["escape"])
|
|
1338
|
+
],
|
|
1339
|
+
onClick: _cache[2] || (_cache[2] = withModifiers(() => {
|
|
1340
|
+
}, ["stop"])),
|
|
1341
|
+
ref_for: true,
|
|
1342
|
+
ref_key: "editInputEl",
|
|
1343
|
+
ref: editInputEl
|
|
1344
|
+
}, null, 544)), [
|
|
1345
|
+
[vModelText, editName.value]
|
|
1346
|
+
]) : (openBlock(), createElementBlock("div", {
|
|
1347
|
+
key: 1,
|
|
1348
|
+
class: "poi-item__name",
|
|
1349
|
+
onDblclick: withModifiers(($event) => startEdit(item), ["stop"])
|
|
1350
|
+
}, toDisplayString(item.name), 41, _hoisted_13$1)),
|
|
1351
|
+
createElementVNode("div", _hoisted_14$1, toDisplayString(item.lng.toFixed(4)) + ", " + toDisplayString(item.lat.toFixed(4)), 1)
|
|
1352
|
+
]),
|
|
1353
|
+
createElementVNode("div", _hoisted_15$1, [
|
|
1354
|
+
createElementVNode("button", {
|
|
1355
|
+
class: "icon-btn",
|
|
1356
|
+
title: "编辑名称",
|
|
1357
|
+
onClick: withModifiers(($event) => startEdit(item), ["stop"])
|
|
1358
|
+
}, [..._cache[8] || (_cache[8] = [
|
|
1359
|
+
createElementVNode("i", { class: "fa fa-pencil" }, null, -1)
|
|
1360
|
+
])], 8, _hoisted_16$1),
|
|
1361
|
+
createElementVNode("button", {
|
|
1362
|
+
class: "icon-btn",
|
|
1363
|
+
title: "飞行定位",
|
|
1364
|
+
onClick: withModifiers(($event) => onFlyTo(item.id), ["stop"])
|
|
1365
|
+
}, [..._cache[9] || (_cache[9] = [
|
|
1366
|
+
createElementVNode("i", { class: "fa fa-crosshairs" }, null, -1)
|
|
1367
|
+
])], 8, _hoisted_17$1),
|
|
1368
|
+
createElementVNode("button", {
|
|
1369
|
+
class: "icon-btn icon-btn--danger",
|
|
1370
|
+
title: "删除",
|
|
1371
|
+
onClick: withModifiers(($event) => onRemove(item.id), ["stop"])
|
|
1372
|
+
}, [..._cache[10] || (_cache[10] = [
|
|
1373
|
+
createElementVNode("i", { class: "fa fa-times" }, null, -1)
|
|
1374
|
+
])], 8, _hoisted_18$1)
|
|
1375
|
+
])
|
|
1376
|
+
], 10, _hoisted_11$1);
|
|
1377
|
+
}), 128))
|
|
1378
|
+
]),
|
|
1379
|
+
_: 1
|
|
1380
|
+
}),
|
|
1381
|
+
filteredList.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_19$1, [
|
|
1382
|
+
_cache[11] || (_cache[11] = createElementVNode("i", { class: "fa fa-map-o" }, null, -1)),
|
|
1383
|
+
createElementVNode("p", null, toDisplayString(unref(poi).isAddMode.value ? "请在地图上点击添加标注" : "暂无标注数据"), 1)
|
|
1384
|
+
])) : createCommentVNode("", true)
|
|
1385
|
+
])
|
|
1386
|
+
], 512), [
|
|
1387
|
+
[vShow, !isCollapsed.value]
|
|
1388
|
+
])
|
|
1389
|
+
], 6);
|
|
1390
|
+
};
|
|
1391
|
+
}
|
|
1392
|
+
});
|
|
1393
|
+
const PoiMarkerPanel = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-b2f25973"]]);
|
|
1394
|
+
let _idCounter = 1;
|
|
1395
|
+
function useTrack(mapCtx) {
|
|
1396
|
+
const trackLayer = shallowRef(null);
|
|
1397
|
+
const trackList = ref([]);
|
|
1398
|
+
const activeTrackId = ref(null);
|
|
1399
|
+
const isPlaying = ref(false);
|
|
1400
|
+
const currentTime = ref(0);
|
|
1401
|
+
const playbackSpeed = ref(1);
|
|
1402
|
+
const playbackProgress = ref(0);
|
|
1403
|
+
const isRealtimeMode = ref(false);
|
|
1404
|
+
const activeRealtimeId = ref(null);
|
|
1405
|
+
let _playInterval = null;
|
|
1406
|
+
function initTrackLayer() {
|
|
1407
|
+
const map = mapCtx.map.value;
|
|
1408
|
+
if (!map) return;
|
|
1409
|
+
const layer = new mars3d.layer.GraphicLayer();
|
|
1410
|
+
map.addLayer(layer);
|
|
1411
|
+
trackLayer.value = layer;
|
|
1412
|
+
}
|
|
1413
|
+
function _buildLineGraphic(track) {
|
|
1414
|
+
const layer = trackLayer.value;
|
|
1415
|
+
if (!layer) return null;
|
|
1416
|
+
const positions = track.points.map((p) => [p.lng, p.lat, p.alt]);
|
|
1417
|
+
const line = new mars3d.graphic.PolylinePrimitive({
|
|
1418
|
+
positions,
|
|
1419
|
+
style: {
|
|
1420
|
+
color: mars3d.Cesium.Color.fromCssColorString("#3ea6ff"),
|
|
1421
|
+
width: 3,
|
|
1422
|
+
opacity: 0.9,
|
|
1423
|
+
clampToGround: false
|
|
1424
|
+
},
|
|
1425
|
+
attr: { trackId: track.id }
|
|
1426
|
+
});
|
|
1427
|
+
layer.addGraphic(line);
|
|
1428
|
+
return line;
|
|
1429
|
+
}
|
|
1430
|
+
function _appendRealtimeLine(track, fromIdx, toIdx) {
|
|
1431
|
+
const layer = trackLayer.value;
|
|
1432
|
+
if (!layer || toIdx <= fromIdx) return;
|
|
1433
|
+
const positions = track.points.slice(fromIdx, toIdx + 1).map((p) => [p.lng, p.lat, p.alt]);
|
|
1434
|
+
const segment = new mars3d.graphic.PolylinePrimitive({
|
|
1435
|
+
positions,
|
|
1436
|
+
style: {
|
|
1437
|
+
color: mars3d.Cesium.Color.fromCssColorString("#ff6b35"),
|
|
1438
|
+
width: 4,
|
|
1439
|
+
opacity: 1,
|
|
1440
|
+
clampToGround: false
|
|
1441
|
+
}
|
|
1442
|
+
});
|
|
1443
|
+
layer.addGraphic(segment);
|
|
1444
|
+
if (!track.realtimeLineSegments) {
|
|
1445
|
+
track.realtimeLineSegments = [];
|
|
1446
|
+
}
|
|
1447
|
+
track.realtimeLineSegments.push(segment);
|
|
1448
|
+
}
|
|
1449
|
+
function _updateRealtimeMarker(track) {
|
|
1450
|
+
const layer = trackLayer.value;
|
|
1451
|
+
if (!layer) return;
|
|
1452
|
+
const lastPoint = track.points[track.realtimeDrawnIdx];
|
|
1453
|
+
if (!lastPoint) return;
|
|
1454
|
+
if (track.realtimePoint) {
|
|
1455
|
+
track.realtimePoint.position = [lastPoint.lng, lastPoint.lat, lastPoint.alt];
|
|
1456
|
+
} else {
|
|
1457
|
+
const marker = new mars3d.graphic.BillboardEntity({
|
|
1458
|
+
position: [lastPoint.lng, lastPoint.lat, lastPoint.alt],
|
|
1459
|
+
style: {
|
|
1460
|
+
image: "//data.mars3d.cn/img/marker/mark-blue.png",
|
|
1461
|
+
scale: 1.2,
|
|
1462
|
+
horizontalOrigin: mars3d.Cesium.HorizontalOrigin.CENTER,
|
|
1463
|
+
verticalOrigin: mars3d.Cesium.VerticalOrigin.BOTTOM
|
|
1464
|
+
}
|
|
1465
|
+
});
|
|
1466
|
+
layer.addGraphic(marker);
|
|
1467
|
+
track.realtimePoint = marker;
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
function addTrack(points, name = "轨迹") {
|
|
1471
|
+
const layer = trackLayer.value;
|
|
1472
|
+
if (!layer) return null;
|
|
1473
|
+
const id = `track-${_idCounter++}`;
|
|
1474
|
+
const track = { id, name, points };
|
|
1475
|
+
track.lineGraphic = _buildLineGraphic(track);
|
|
1476
|
+
trackList.value.push(track);
|
|
1477
|
+
return track;
|
|
1478
|
+
}
|
|
1479
|
+
function startRealtime(name = "实时轨迹") {
|
|
1480
|
+
if (activeRealtimeId.value) stopRealtime();
|
|
1481
|
+
const layer = trackLayer.value;
|
|
1482
|
+
if (!layer) return null;
|
|
1483
|
+
const id = `realtime-${_idCounter++}`;
|
|
1484
|
+
const track = {
|
|
1485
|
+
id,
|
|
1486
|
+
name,
|
|
1487
|
+
points: [],
|
|
1488
|
+
realtimeDrawnIdx: -1
|
|
1489
|
+
};
|
|
1490
|
+
trackLayer.value = layer;
|
|
1491
|
+
trackList.value.push(track);
|
|
1492
|
+
activeRealtimeId.value = id;
|
|
1493
|
+
isRealtimeMode.value = true;
|
|
1494
|
+
return track;
|
|
1495
|
+
}
|
|
1496
|
+
function pushRealtimePoint(id, lng, lat, alt = 0) {
|
|
1497
|
+
const track = trackList.value.find((t) => t.id === id);
|
|
1498
|
+
if (!track) return;
|
|
1499
|
+
const point = {
|
|
1500
|
+
time: Date.now(),
|
|
1501
|
+
lng,
|
|
1502
|
+
lat,
|
|
1503
|
+
alt
|
|
1504
|
+
};
|
|
1505
|
+
track.points.push(point);
|
|
1506
|
+
track.realtimeDrawnIdx = track.points.length - 1;
|
|
1507
|
+
if (track.points.length === 1) {
|
|
1508
|
+
track.lineGraphic = _buildLineGraphic(track);
|
|
1509
|
+
_updateRealtimeMarker(track);
|
|
1510
|
+
} else {
|
|
1511
|
+
_appendRealtimeLine(track, track.points.length - 2, track.points.length - 1);
|
|
1512
|
+
_updateRealtimeMarker(track);
|
|
1513
|
+
}
|
|
1514
|
+
if (mapCtx.map.value) {
|
|
1515
|
+
mapCtx.map.value.flyToPoint(
|
|
1516
|
+
[lng, lat, alt + 50],
|
|
1517
|
+
{ radius: 500, duration: 0.5 }
|
|
1518
|
+
);
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
function stopRealtime(id) {
|
|
1522
|
+
var _a;
|
|
1523
|
+
const targetId = id ?? activeRealtimeId.value;
|
|
1524
|
+
if (!targetId) return;
|
|
1525
|
+
const track = trackList.value.find((t) => t.id === targetId);
|
|
1526
|
+
if (track) {
|
|
1527
|
+
track.realtimeDrawnIdx = void 0;
|
|
1528
|
+
if (track.realtimePoint) {
|
|
1529
|
+
(_a = trackLayer.value) == null ? void 0 : _a.removeGraphic(track.realtimePoint);
|
|
1530
|
+
track.realtimePoint = void 0;
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
if (activeRealtimeId.value === targetId) {
|
|
1534
|
+
activeRealtimeId.value = null;
|
|
1535
|
+
isRealtimeMode.value = false;
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
function play(trackId) {
|
|
1539
|
+
const id = trackId ?? activeTrackId.value;
|
|
1540
|
+
if (!id) return;
|
|
1541
|
+
const track = trackList.value.find((t) => t.id === id);
|
|
1542
|
+
if (!track || track.points.length < 2) return;
|
|
1543
|
+
if (activeTrackId.value !== id) {
|
|
1544
|
+
selectTrack(id);
|
|
1545
|
+
}
|
|
1546
|
+
isPlaying.value = true;
|
|
1547
|
+
_clearPlayInterval();
|
|
1548
|
+
const start = track.points[0].time;
|
|
1549
|
+
const end = track.points[track.points.length - 1].time;
|
|
1550
|
+
_playInterval = setInterval(() => {
|
|
1551
|
+
const track2 = trackList.value.find((t) => t.id === activeTrackId.value);
|
|
1552
|
+
if (!track2 || !isPlaying.value) return;
|
|
1553
|
+
const elapsed = Date.now() - (track2._playStartTime ?? Date.now());
|
|
1554
|
+
const total = end - start;
|
|
1555
|
+
const progress = Math.min(elapsed / total, 1);
|
|
1556
|
+
currentTime.value = start + progress * total;
|
|
1557
|
+
playbackProgress.value = progress * 100;
|
|
1558
|
+
const targetIdx = Math.floor(progress * (track2.points.length - 1));
|
|
1559
|
+
_updatePlaybackLine(track2, targetIdx);
|
|
1560
|
+
}, 60);
|
|
1561
|
+
}
|
|
1562
|
+
function _updatePlaybackLine(track, toIdx) {
|
|
1563
|
+
var _a;
|
|
1564
|
+
const layer = trackLayer.value;
|
|
1565
|
+
if (!layer) return;
|
|
1566
|
+
if (track.lineGraphic) {
|
|
1567
|
+
layer.removeGraphic(track.lineGraphic);
|
|
1568
|
+
}
|
|
1569
|
+
const positions = track.points.slice(0, toIdx + 1).map((p) => [p.lng, p.lat, p.alt]);
|
|
1570
|
+
track.lineGraphic = new mars3d.graphic.PolylinePrimitive({
|
|
1571
|
+
positions,
|
|
1572
|
+
style: {
|
|
1573
|
+
color: mars3d.Cesium.Color.fromCssColorString("#00ff88"),
|
|
1574
|
+
width: 4,
|
|
1575
|
+
opacity: 1,
|
|
1576
|
+
clampToGround: false
|
|
1577
|
+
}
|
|
1578
|
+
});
|
|
1579
|
+
layer.addGraphic(track.lineGraphic);
|
|
1580
|
+
const pt = track.points[toIdx];
|
|
1581
|
+
(_a = mapCtx.map.value) == null ? void 0 : _a.flyToPoint(
|
|
1582
|
+
[pt.lng, pt.lat, pt.alt + 200],
|
|
1583
|
+
{ radius: 300, duration: 0 }
|
|
1584
|
+
);
|
|
1585
|
+
}
|
|
1586
|
+
function pause() {
|
|
1587
|
+
isPlaying.value = false;
|
|
1588
|
+
_clearPlayInterval();
|
|
1589
|
+
}
|
|
1590
|
+
function stop() {
|
|
1591
|
+
isPlaying.value = false;
|
|
1592
|
+
playbackProgress.value = 0;
|
|
1593
|
+
currentTime.value = 0;
|
|
1594
|
+
_clearPlayInterval();
|
|
1595
|
+
const track = trackList.value.find((t) => t.id === activeTrackId.value);
|
|
1596
|
+
if (track && trackLayer.value) {
|
|
1597
|
+
if (track.lineGraphic) trackLayer.value.removeGraphic(track.lineGraphic);
|
|
1598
|
+
track.lineGraphic = _buildLineGraphic(track);
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
function setSpeed(speed) {
|
|
1602
|
+
playbackSpeed.value = speed;
|
|
1603
|
+
if (isPlaying.value) {
|
|
1604
|
+
pause();
|
|
1605
|
+
play();
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
function seek(progress) {
|
|
1609
|
+
const track = trackList.value.find((t) => t.id === activeTrackId.value);
|
|
1610
|
+
if (!track) return;
|
|
1611
|
+
const targetIdx = Math.floor(progress / 100 * (track.points.length - 1));
|
|
1612
|
+
currentTime.value = track.points[targetIdx].time;
|
|
1613
|
+
playbackProgress.value = progress;
|
|
1614
|
+
_updatePlaybackLine(track, targetIdx);
|
|
1615
|
+
}
|
|
1616
|
+
function selectTrack(id) {
|
|
1617
|
+
activeTrackId.value = id;
|
|
1618
|
+
stop();
|
|
1619
|
+
}
|
|
1620
|
+
function flyToTrack(id) {
|
|
1621
|
+
const track = trackList.value.find((t) => t.id === id);
|
|
1622
|
+
if (!track || !mapCtx.map.value) return;
|
|
1623
|
+
const first = track.points[0];
|
|
1624
|
+
mapCtx.map.value.flyToPoint(
|
|
1625
|
+
[first.lng, first.lat, first.alt + 2e3],
|
|
1626
|
+
{ radius: 3e3, duration: 1.5 }
|
|
1627
|
+
);
|
|
1628
|
+
}
|
|
1629
|
+
function removeTrack(id) {
|
|
1630
|
+
var _a, _b;
|
|
1631
|
+
const idx = trackList.value.findIndex((t) => t.id === id);
|
|
1632
|
+
if (idx === -1) return;
|
|
1633
|
+
const track = trackList.value[idx];
|
|
1634
|
+
if (track.lineGraphic) (_a = trackLayer.value) == null ? void 0 : _a.removeGraphic(track.lineGraphic);
|
|
1635
|
+
if (track.realtimePoint) (_b = trackLayer.value) == null ? void 0 : _b.removeGraphic(track.realtimePoint);
|
|
1636
|
+
if (track.realtimeLineSegments) {
|
|
1637
|
+
track.realtimeLineSegments.forEach((seg) => {
|
|
1638
|
+
var _a2;
|
|
1639
|
+
(_a2 = trackLayer.value) == null ? void 0 : _a2.removeGraphic(seg);
|
|
1640
|
+
});
|
|
1641
|
+
}
|
|
1642
|
+
trackList.value.splice(idx, 1);
|
|
1643
|
+
if (activeTrackId.value === id) {
|
|
1644
|
+
activeTrackId.value = null;
|
|
1645
|
+
stop();
|
|
1646
|
+
}
|
|
1647
|
+
if (activeRealtimeId.value === id) {
|
|
1648
|
+
activeRealtimeId.value = null;
|
|
1649
|
+
isRealtimeMode.value = false;
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
function clearAll() {
|
|
1653
|
+
var _a;
|
|
1654
|
+
stop();
|
|
1655
|
+
stopRealtime();
|
|
1656
|
+
(_a = trackLayer.value) == null ? void 0 : _a.clear();
|
|
1657
|
+
trackList.value = [];
|
|
1658
|
+
activeTrackId.value = null;
|
|
1659
|
+
}
|
|
1660
|
+
function _clearPlayInterval() {
|
|
1661
|
+
if (_playInterval) {
|
|
1662
|
+
clearInterval(_playInterval);
|
|
1663
|
+
_playInterval = null;
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
return {
|
|
1667
|
+
trackLayer,
|
|
1668
|
+
trackList,
|
|
1669
|
+
activeTrackId,
|
|
1670
|
+
isPlaying,
|
|
1671
|
+
currentTime,
|
|
1672
|
+
playbackSpeed,
|
|
1673
|
+
playbackProgress,
|
|
1674
|
+
isRealtimeMode,
|
|
1675
|
+
activeRealtimeId,
|
|
1676
|
+
initTrackLayer,
|
|
1677
|
+
addTrack,
|
|
1678
|
+
startRealtime,
|
|
1679
|
+
pushRealtimePoint,
|
|
1680
|
+
stopRealtime,
|
|
1681
|
+
play,
|
|
1682
|
+
pause,
|
|
1683
|
+
stop,
|
|
1684
|
+
setSpeed,
|
|
1685
|
+
seek,
|
|
1686
|
+
selectTrack,
|
|
1687
|
+
flyToTrack,
|
|
1688
|
+
removeTrack,
|
|
1689
|
+
clearAll
|
|
1690
|
+
};
|
|
1691
|
+
}
|
|
1692
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
1693
|
+
__name: "TrackLayer",
|
|
1694
|
+
setup(__props, { expose: __expose }) {
|
|
1695
|
+
const mapCtx = inject("mapContext");
|
|
1696
|
+
if (!mapCtx) throw new Error("[TrackLayer] 必须放置在 MarsMapContainer 内部");
|
|
1697
|
+
const track = useTrack(mapCtx);
|
|
1698
|
+
const stopWatch = watch(
|
|
1699
|
+
() => mapCtx.map.value,
|
|
1700
|
+
(map) => {
|
|
1701
|
+
if (map) {
|
|
1702
|
+
track.initTrackLayer();
|
|
1703
|
+
stopWatch();
|
|
1704
|
+
}
|
|
1705
|
+
},
|
|
1706
|
+
{ immediate: true }
|
|
1707
|
+
);
|
|
1708
|
+
onUnmounted(() => {
|
|
1709
|
+
track.clearAll();
|
|
1710
|
+
});
|
|
1711
|
+
provide("trackContext", track);
|
|
1712
|
+
__expose(track);
|
|
1713
|
+
return (_ctx, _cache) => {
|
|
1714
|
+
return renderSlot(_ctx.$slots, "default");
|
|
1715
|
+
};
|
|
1716
|
+
}
|
|
1717
|
+
});
|
|
1718
|
+
const _hoisted_1 = {
|
|
1719
|
+
key: 0,
|
|
1720
|
+
class: "collapsed-icon-wrap"
|
|
1721
|
+
};
|
|
1722
|
+
const _hoisted_2 = { class: "track-badge" };
|
|
1723
|
+
const _hoisted_3 = { class: "track-panel__title" };
|
|
1724
|
+
const _hoisted_4 = { class: "track-count" };
|
|
1725
|
+
const _hoisted_5 = { class: "track-panel__body" };
|
|
1726
|
+
const _hoisted_6 = { class: "track-panel__toolbar" };
|
|
1727
|
+
const _hoisted_7 = ["disabled"];
|
|
1728
|
+
const _hoisted_8 = {
|
|
1729
|
+
key: 0,
|
|
1730
|
+
class: "track-panel__playback"
|
|
1731
|
+
};
|
|
1732
|
+
const _hoisted_9 = { class: "playback__track-name" };
|
|
1733
|
+
const _hoisted_10 = { class: "playback__controls" };
|
|
1734
|
+
const _hoisted_11 = { class: "playback__speed" };
|
|
1735
|
+
const _hoisted_12 = { class: "speed-btns" };
|
|
1736
|
+
const _hoisted_13 = ["onClick"];
|
|
1737
|
+
const _hoisted_14 = { class: "playback__timeline" };
|
|
1738
|
+
const _hoisted_15 = { class: "time-label" };
|
|
1739
|
+
const _hoisted_16 = ["value"];
|
|
1740
|
+
const _hoisted_17 = { class: "time-label" };
|
|
1741
|
+
const _hoisted_18 = {
|
|
1742
|
+
key: 1,
|
|
1743
|
+
class: "track-panel__realtime-hint"
|
|
1744
|
+
};
|
|
1745
|
+
const _hoisted_19 = { class: "realtime-count" };
|
|
1746
|
+
const _hoisted_20 = { class: "track-panel__list" };
|
|
1747
|
+
const _hoisted_21 = ["onClick"];
|
|
1748
|
+
const _hoisted_22 = { class: "track-item__info" };
|
|
1749
|
+
const _hoisted_23 = { class: "track-item__name" };
|
|
1750
|
+
const _hoisted_24 = { class: "track-item__meta" };
|
|
1751
|
+
const _hoisted_25 = {
|
|
1752
|
+
key: 0,
|
|
1753
|
+
class: "realtime-tag"
|
|
1754
|
+
};
|
|
1755
|
+
const _hoisted_26 = { class: "track-item__actions" };
|
|
1756
|
+
const _hoisted_27 = ["onClick"];
|
|
1757
|
+
const _hoisted_28 = ["onClick"];
|
|
1758
|
+
const _hoisted_29 = {
|
|
1759
|
+
key: 0,
|
|
1760
|
+
class: "track-panel__empty"
|
|
1761
|
+
};
|
|
1762
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
1763
|
+
__name: "TrackPanel",
|
|
1764
|
+
setup(__props) {
|
|
1765
|
+
const track = inject("trackContext");
|
|
1766
|
+
if (!track) throw new Error("[TrackPanel] 必须与 TrackLayer 同级使用");
|
|
1767
|
+
const isCollapsed = ref(true);
|
|
1768
|
+
const isDragging = ref(false);
|
|
1769
|
+
const pos = reactive({ x: 10, y: 80 });
|
|
1770
|
+
let dragStartX = 0, dragStartY = 0, origX = 0, origY = 0;
|
|
1771
|
+
function toggleCollapse() {
|
|
1772
|
+
isCollapsed.value = !isCollapsed.value;
|
|
1773
|
+
}
|
|
1774
|
+
function startDrag(e) {
|
|
1775
|
+
isDragging.value = true;
|
|
1776
|
+
dragStartX = e.clientX;
|
|
1777
|
+
dragStartY = e.clientY;
|
|
1778
|
+
origX = pos.x;
|
|
1779
|
+
origY = pos.y;
|
|
1780
|
+
document.addEventListener("mousemove", onDrag);
|
|
1781
|
+
document.addEventListener("mouseup", stopDrag);
|
|
1782
|
+
}
|
|
1783
|
+
function onDrag(e) {
|
|
1784
|
+
if (!isDragging.value) return;
|
|
1785
|
+
pos.x = origX + (e.clientX - dragStartX);
|
|
1786
|
+
pos.y = origY + (e.clientY - dragStartY);
|
|
1787
|
+
}
|
|
1788
|
+
function stopDrag() {
|
|
1789
|
+
isDragging.value = false;
|
|
1790
|
+
document.removeEventListener("mousemove", onDrag);
|
|
1791
|
+
document.removeEventListener("mouseup", stopDrag);
|
|
1792
|
+
}
|
|
1793
|
+
function onSelectTrack(id) {
|
|
1794
|
+
if (track.activeTrackId.value === id) return;
|
|
1795
|
+
track.selectTrack(id);
|
|
1796
|
+
track.stop();
|
|
1797
|
+
}
|
|
1798
|
+
const activeTrackName = computed(() => {
|
|
1799
|
+
const t = track.trackList.value.find(
|
|
1800
|
+
(x) => x.id === track.activeTrackId.value
|
|
1801
|
+
);
|
|
1802
|
+
return (t == null ? void 0 : t.name) ?? "";
|
|
1803
|
+
});
|
|
1804
|
+
const trackMaxTime = computed(() => {
|
|
1805
|
+
const t = track.trackList.value.find(
|
|
1806
|
+
(x) => x.id === track.activeTrackId.value
|
|
1807
|
+
);
|
|
1808
|
+
if (!t || t.points.length < 2) return 0;
|
|
1809
|
+
return t.points[t.points.length - 1].time;
|
|
1810
|
+
});
|
|
1811
|
+
const speedOptions = [1, 2, 4, 8];
|
|
1812
|
+
function onSeek(e) {
|
|
1813
|
+
const val = parseFloat(e.target.value);
|
|
1814
|
+
track.seek(val);
|
|
1815
|
+
}
|
|
1816
|
+
function formatTime(ts) {
|
|
1817
|
+
if (!ts) return "00:00";
|
|
1818
|
+
const d = new Date(ts);
|
|
1819
|
+
return `${String(d.getMinutes()).padStart(2, "0")}:${String(d.getSeconds()).padStart(2, "0")}`;
|
|
1820
|
+
}
|
|
1821
|
+
function addDemoTrack() {
|
|
1822
|
+
const baseLng = 116.3974;
|
|
1823
|
+
const baseLat = 39.909;
|
|
1824
|
+
const points = [];
|
|
1825
|
+
let t = Date.now();
|
|
1826
|
+
let heading = Math.random() * Math.PI * 2;
|
|
1827
|
+
const STEP = 20;
|
|
1828
|
+
for (let i = 0; i < STEP; i++) {
|
|
1829
|
+
t += 5e3 + Math.random() * 5e3;
|
|
1830
|
+
heading += (Math.random() - 0.5) * (Math.PI / 6);
|
|
1831
|
+
const stepLng = baseLng + Math.cos(heading) * 4e-3;
|
|
1832
|
+
const stepLat = baseLat + Math.sin(heading) * 2e-3;
|
|
1833
|
+
const alt = 30 + Math.sin(i / STEP * Math.PI) * 80;
|
|
1834
|
+
points.push({ time: t, lng: stepLng, lat: stepLat, alt });
|
|
1835
|
+
}
|
|
1836
|
+
track.addTrack(points, `轨迹 ${_counter++}`);
|
|
1837
|
+
}
|
|
1838
|
+
let _counter = 1;
|
|
1839
|
+
let _realtimeTimer = null;
|
|
1840
|
+
let _currentRealtimeId = null;
|
|
1841
|
+
function toggleRealtime() {
|
|
1842
|
+
if (track.isRealtimeMode.value) {
|
|
1843
|
+
stopRealtime();
|
|
1844
|
+
} else {
|
|
1845
|
+
startRealtime();
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
function startRealtime() {
|
|
1849
|
+
var _a;
|
|
1850
|
+
const id = (_a = track.startRealtime(`实时轨迹 ${_counter++}`)) == null ? void 0 : _a.id;
|
|
1851
|
+
if (!id) return;
|
|
1852
|
+
_currentRealtimeId = id;
|
|
1853
|
+
const CENTER_LNG = 116.397;
|
|
1854
|
+
const CENTER_LAT = 39.908;
|
|
1855
|
+
const RADIUS_LNG = 4e-3;
|
|
1856
|
+
const RADIUS_LAT = 3e-3;
|
|
1857
|
+
const TOTAL_POINTS = 36;
|
|
1858
|
+
const ANGLE_STEP = 2 * Math.PI / TOTAL_POINTS;
|
|
1859
|
+
let angle = Math.random() * 2 * Math.PI;
|
|
1860
|
+
let pushCount = 0;
|
|
1861
|
+
_realtimeTimer = setInterval(() => {
|
|
1862
|
+
pushCount++;
|
|
1863
|
+
const lng = CENTER_LNG + Math.cos(angle) * RADIUS_LNG;
|
|
1864
|
+
const lat = CENTER_LAT + Math.sin(angle) * RADIUS_LAT;
|
|
1865
|
+
const alt = 40 + Math.sin(angle * 3) * 20;
|
|
1866
|
+
track.pushRealtimePoint(id, lng, lat, alt);
|
|
1867
|
+
angle += ANGLE_STEP;
|
|
1868
|
+
if (pushCount >= TOTAL_POINTS) {
|
|
1869
|
+
stopRealtime();
|
|
1870
|
+
}
|
|
1871
|
+
}, 800);
|
|
1872
|
+
}
|
|
1873
|
+
function stopRealtime() {
|
|
1874
|
+
if (_realtimeTimer) {
|
|
1875
|
+
clearInterval(_realtimeTimer);
|
|
1876
|
+
_realtimeTimer = null;
|
|
1877
|
+
}
|
|
1878
|
+
if (_currentRealtimeId) {
|
|
1879
|
+
track.stopRealtime(_currentRealtimeId);
|
|
1880
|
+
_currentRealtimeId = null;
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
const realtimePointCount = computed(() => {
|
|
1884
|
+
const t = track.trackList.value.find((x) => x.id === _currentRealtimeId);
|
|
1885
|
+
return (t == null ? void 0 : t.points.length) ?? 0;
|
|
1886
|
+
});
|
|
1887
|
+
function confirmClear() {
|
|
1888
|
+
if (window.confirm(`确认清空全部 ${track.trackList.value.length} 条轨迹?`)) {
|
|
1889
|
+
stopRealtime();
|
|
1890
|
+
track.clearAll();
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1893
|
+
return (_ctx, _cache) => {
|
|
1894
|
+
return openBlock(), createElementBlock("div", {
|
|
1895
|
+
class: normalizeClass(["track-panel", { collapsed: isCollapsed.value }]),
|
|
1896
|
+
style: normalizeStyle({ left: pos.x + "px", top: pos.y + "px" })
|
|
1897
|
+
}, [
|
|
1898
|
+
createElementVNode("div", {
|
|
1899
|
+
class: normalizeClass(["track-panel__header", { "is-dragging": isDragging.value }]),
|
|
1900
|
+
onMousedown: withModifiers(startDrag, ["prevent"]),
|
|
1901
|
+
onClick: _cache[0] || (_cache[0] = ($event) => isDragging.value ? null : toggleCollapse())
|
|
1902
|
+
}, [
|
|
1903
|
+
isCollapsed.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
1904
|
+
_cache[4] || (_cache[4] = createElementVNode("i", { class: "fa fa-share-alt collapsed-icon" }, null, -1)),
|
|
1905
|
+
createElementVNode("span", _hoisted_2, toDisplayString(unref(track).trackList.value.length), 1)
|
|
1906
|
+
])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1907
|
+
createElementVNode("span", _hoisted_3, [
|
|
1908
|
+
_cache[5] || (_cache[5] = createElementVNode("i", { class: "fa fa-share-alt" }, null, -1)),
|
|
1909
|
+
_cache[6] || (_cache[6] = createTextVNode(" 轨迹管理 ", -1)),
|
|
1910
|
+
createElementVNode("span", _hoisted_4, toDisplayString(unref(track).trackList.value.length), 1)
|
|
1911
|
+
]),
|
|
1912
|
+
_cache[7] || (_cache[7] = createElementVNode("i", { class: "fa fa-chevron-left collapse-icon" }, null, -1))
|
|
1913
|
+
], 64))
|
|
1914
|
+
], 34),
|
|
1915
|
+
withDirectives(createElementVNode("div", _hoisted_5, [
|
|
1916
|
+
createElementVNode("div", _hoisted_6, [
|
|
1917
|
+
createElementVNode("button", {
|
|
1918
|
+
class: "btn btn--primary",
|
|
1919
|
+
onClick: addDemoTrack
|
|
1920
|
+
}, [..._cache[8] || (_cache[8] = [
|
|
1921
|
+
createElementVNode("i", { class: "fa fa-plus" }, null, -1),
|
|
1922
|
+
createTextVNode(" 历史轨迹 ", -1)
|
|
1923
|
+
])]),
|
|
1924
|
+
createElementVNode("button", {
|
|
1925
|
+
class: normalizeClass(["btn", unref(track).isRealtimeMode.value ? "btn--active" : "btn--info"]),
|
|
1926
|
+
onClick: toggleRealtime
|
|
1927
|
+
}, [
|
|
1928
|
+
createElementVNode("i", {
|
|
1929
|
+
class: normalizeClass(["fa", unref(track).isRealtimeMode.value ? "fa-stop" : "fa-bolt"])
|
|
1930
|
+
}, null, 2),
|
|
1931
|
+
createTextVNode(" " + toDisplayString(unref(track).isRealtimeMode.value ? "停止推送" : "实时轨迹"), 1)
|
|
1932
|
+
], 2),
|
|
1933
|
+
createElementVNode("button", {
|
|
1934
|
+
class: "btn btn--danger",
|
|
1935
|
+
onClick: confirmClear,
|
|
1936
|
+
disabled: unref(track).trackList.value.length === 0
|
|
1937
|
+
}, [..._cache[9] || (_cache[9] = [
|
|
1938
|
+
createElementVNode("i", { class: "fa fa-trash-o" }, null, -1)
|
|
1939
|
+
])], 8, _hoisted_7)
|
|
1940
|
+
]),
|
|
1941
|
+
unref(track).activeTrackId.value ? (openBlock(), createElementBlock("div", _hoisted_8, [
|
|
1942
|
+
createElementVNode("div", _hoisted_9, [
|
|
1943
|
+
_cache[10] || (_cache[10] = createElementVNode("i", { class: "fa fa-road" }, null, -1)),
|
|
1944
|
+
createTextVNode(" " + toDisplayString(activeTrackName.value) + " ", 1),
|
|
1945
|
+
_cache[11] || (_cache[11] = createElementVNode("span", { class: "playback__mode-badge" }, "历史回放", -1))
|
|
1946
|
+
]),
|
|
1947
|
+
createElementVNode("div", _hoisted_10, [
|
|
1948
|
+
createElementVNode("button", {
|
|
1949
|
+
class: "ctrl-btn",
|
|
1950
|
+
onClick: _cache[1] || (_cache[1] = ($event) => unref(track).stop())
|
|
1951
|
+
}, [..._cache[12] || (_cache[12] = [
|
|
1952
|
+
createElementVNode("i", { class: "fa fa-stop" }, null, -1)
|
|
1953
|
+
])]),
|
|
1954
|
+
createElementVNode("button", {
|
|
1955
|
+
class: "ctrl-btn ctrl-btn--play",
|
|
1956
|
+
onClick: _cache[2] || (_cache[2] = ($event) => unref(track).isPlaying.value ? unref(track).pause() : unref(track).play())
|
|
1957
|
+
}, [
|
|
1958
|
+
createElementVNode("i", {
|
|
1959
|
+
class: normalizeClass(["fa", unref(track).isPlaying.value ? "fa-pause" : "fa-play"])
|
|
1960
|
+
}, null, 2)
|
|
1961
|
+
]),
|
|
1962
|
+
createElementVNode("button", {
|
|
1963
|
+
class: "ctrl-btn",
|
|
1964
|
+
onClick: _cache[3] || (_cache[3] = ($event) => unref(track).play())
|
|
1965
|
+
}, [..._cache[13] || (_cache[13] = [
|
|
1966
|
+
createElementVNode("i", { class: "fa fa-refresh" }, null, -1)
|
|
1967
|
+
])])
|
|
1968
|
+
]),
|
|
1969
|
+
createElementVNode("div", _hoisted_11, [
|
|
1970
|
+
_cache[14] || (_cache[14] = createElementVNode("span", { class: "speed-label" }, "倍速", -1)),
|
|
1971
|
+
createElementVNode("div", _hoisted_12, [
|
|
1972
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(speedOptions, (s) => {
|
|
1973
|
+
return createElementVNode("button", {
|
|
1974
|
+
key: s,
|
|
1975
|
+
class: normalizeClass(["speed-btn", { active: unref(track).playbackSpeed.value === s }]),
|
|
1976
|
+
onClick: ($event) => unref(track).setSpeed(s)
|
|
1977
|
+
}, toDisplayString(s) + "x ", 11, _hoisted_13);
|
|
1978
|
+
}), 64))
|
|
1979
|
+
])
|
|
1980
|
+
]),
|
|
1981
|
+
createElementVNode("div", _hoisted_14, [
|
|
1982
|
+
createElementVNode("span", _hoisted_15, toDisplayString(formatTime(unref(track).currentTime.value)), 1),
|
|
1983
|
+
createElementVNode("input", {
|
|
1984
|
+
type: "range",
|
|
1985
|
+
class: "progress-slider",
|
|
1986
|
+
min: "0",
|
|
1987
|
+
max: "100",
|
|
1988
|
+
step: "0.1",
|
|
1989
|
+
value: unref(track).playbackProgress.value,
|
|
1990
|
+
onInput: onSeek
|
|
1991
|
+
}, null, 40, _hoisted_16),
|
|
1992
|
+
createElementVNode("span", _hoisted_17, toDisplayString(formatTime(trackMaxTime.value)), 1)
|
|
1993
|
+
])
|
|
1994
|
+
])) : createCommentVNode("", true),
|
|
1995
|
+
unref(track).isRealtimeMode.value && !unref(track).activeTrackId.value ? (openBlock(), createElementBlock("div", _hoisted_18, [
|
|
1996
|
+
_cache[17] || (_cache[17] = createElementVNode("div", { class: "realtime-pulse" }, [
|
|
1997
|
+
createElementVNode("i", { class: "fa fa-bolt" }),
|
|
1998
|
+
createTextVNode(" 实时推送中 "),
|
|
1999
|
+
createElementVNode("span", { class: "blink-dot" })
|
|
2000
|
+
], -1)),
|
|
2001
|
+
createElementVNode("div", _hoisted_19, [
|
|
2002
|
+
_cache[15] || (_cache[15] = createTextVNode(" 已推送 ", -1)),
|
|
2003
|
+
createElementVNode("strong", null, toDisplayString(realtimePointCount.value), 1),
|
|
2004
|
+
_cache[16] || (_cache[16] = createTextVNode(" 个坐标点 ", -1))
|
|
2005
|
+
])
|
|
2006
|
+
])) : createCommentVNode("", true),
|
|
2007
|
+
createElementVNode("div", _hoisted_20, [
|
|
2008
|
+
createVNode(TransitionGroup, { name: "track-list" }, {
|
|
2009
|
+
default: withCtx(() => [
|
|
2010
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(track).trackList.value, (item) => {
|
|
2011
|
+
return openBlock(), createElementBlock("div", {
|
|
2012
|
+
key: item.id,
|
|
2013
|
+
class: normalizeClass(["track-item", {
|
|
2014
|
+
"track-item--active": unref(track).activeTrackId.value === item.id,
|
|
2015
|
+
"track-item--realtime": item.id.startsWith("realtime")
|
|
2016
|
+
}]),
|
|
2017
|
+
onClick: ($event) => onSelectTrack(item.id)
|
|
2018
|
+
}, [
|
|
2019
|
+
createElementVNode("span", {
|
|
2020
|
+
class: "track-item__bar",
|
|
2021
|
+
style: normalizeStyle({
|
|
2022
|
+
background: item.id.startsWith("realtime") ? "#ff6b35" : "#3ea6ff"
|
|
2023
|
+
})
|
|
2024
|
+
}, null, 4),
|
|
2025
|
+
createElementVNode("div", _hoisted_22, [
|
|
2026
|
+
createElementVNode("div", _hoisted_23, [
|
|
2027
|
+
createElementVNode("i", {
|
|
2028
|
+
class: normalizeClass([
|
|
2029
|
+
"fa",
|
|
2030
|
+
item.id.startsWith("realtime") ? "fa-bolt" : "fa-road"
|
|
2031
|
+
])
|
|
2032
|
+
}, null, 2),
|
|
2033
|
+
createTextVNode(" " + toDisplayString(item.name), 1)
|
|
2034
|
+
]),
|
|
2035
|
+
createElementVNode("div", _hoisted_24, [
|
|
2036
|
+
createTextVNode(toDisplayString(item.points.length) + " 个点 ", 1),
|
|
2037
|
+
item.id.startsWith("realtime") ? (openBlock(), createElementBlock("span", _hoisted_25, "实时")) : createCommentVNode("", true)
|
|
2038
|
+
])
|
|
2039
|
+
]),
|
|
2040
|
+
createElementVNode("div", _hoisted_26, [
|
|
2041
|
+
createElementVNode("button", {
|
|
2042
|
+
class: "icon-btn",
|
|
2043
|
+
title: "飞行",
|
|
2044
|
+
onClick: withModifiers(($event) => unref(track).flyToTrack(item.id), ["stop"])
|
|
2045
|
+
}, [..._cache[18] || (_cache[18] = [
|
|
2046
|
+
createElementVNode("i", { class: "fa fa-crosshairs" }, null, -1)
|
|
2047
|
+
])], 8, _hoisted_27),
|
|
2048
|
+
createElementVNode("button", {
|
|
2049
|
+
class: "icon-btn icon-btn--danger",
|
|
2050
|
+
title: "删除",
|
|
2051
|
+
onClick: withModifiers(($event) => unref(track).removeTrack(item.id), ["stop"])
|
|
2052
|
+
}, [..._cache[19] || (_cache[19] = [
|
|
2053
|
+
createElementVNode("i", { class: "fa fa-times" }, null, -1)
|
|
2054
|
+
])], 8, _hoisted_28)
|
|
2055
|
+
])
|
|
2056
|
+
], 10, _hoisted_21);
|
|
2057
|
+
}), 128))
|
|
2058
|
+
]),
|
|
2059
|
+
_: 1
|
|
2060
|
+
}),
|
|
2061
|
+
unref(track).trackList.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_29, [..._cache[20] || (_cache[20] = [
|
|
2062
|
+
createElementVNode("i", { class: "fa fa-map-o" }, null, -1),
|
|
2063
|
+
createElementVNode("p", null, "暂无轨迹数据", -1)
|
|
2064
|
+
])])) : createCommentVNode("", true)
|
|
2065
|
+
])
|
|
2066
|
+
], 512), [
|
|
2067
|
+
[vShow, !isCollapsed.value]
|
|
2068
|
+
])
|
|
2069
|
+
], 6);
|
|
2070
|
+
};
|
|
2071
|
+
}
|
|
2072
|
+
});
|
|
2073
|
+
const TrackPanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3e019b92"]]);
|
|
2074
|
+
const components = {
|
|
2075
|
+
MarsMapContainer,
|
|
2076
|
+
ToolbarPanel,
|
|
2077
|
+
VisionPanel,
|
|
2078
|
+
PoiMarkerLayer: _sfc_main$3,
|
|
2079
|
+
PoiMarkerPanel,
|
|
2080
|
+
TrackLayer: _sfc_main$1,
|
|
2081
|
+
TrackPanel
|
|
2082
|
+
};
|
|
2083
|
+
const YiMap = {
|
|
2084
|
+
install(app, options) {
|
|
2085
|
+
const prefix = (options == null ? void 0 : options.prefix) ?? "";
|
|
2086
|
+
for (const [name, component] of Object.entries(components)) {
|
|
2087
|
+
app.component(prefix ? `${prefix}${name}` : name, component);
|
|
2088
|
+
}
|
|
2089
|
+
}
|
|
2090
|
+
};
|
|
2091
|
+
export {
|
|
2092
|
+
MarsMapContainer,
|
|
2093
|
+
_sfc_main$3 as PoiMarkerLayer,
|
|
2094
|
+
PoiMarkerPanel,
|
|
2095
|
+
ToolbarPanel,
|
|
2096
|
+
_sfc_main$1 as TrackLayer,
|
|
2097
|
+
TrackPanel,
|
|
2098
|
+
VisionPanel,
|
|
2099
|
+
YiMap as default,
|
|
2100
|
+
useDraw,
|
|
2101
|
+
useMap,
|
|
2102
|
+
useMeasure,
|
|
2103
|
+
usePoiMarker,
|
|
2104
|
+
useTrack,
|
|
2105
|
+
useVision
|
|
2106
|
+
};
|
|
2107
|
+
//# sourceMappingURL=yi-map-web.mjs.map
|